def setup_grey_mars_diag(): # create a diagnostics output file for daily snapshots diag = DiagTable() diag.add_file('atmos_daily', 88440, 'seconds', time_units='days') # Define diag tablentries diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk', time_avg=True) diag.add_field('dynamics', 'pk', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True) diag.add_field('dynamics', 'height', time_avg=True) diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('atmosphere', 'precipitation', time_avg=True) diag.add_field('atmosphere', 'dt_tg_convection', time_avg=True) diag.add_field('mixed_layer', 't_surf', time_avg=True) diag.add_field('mixed_layer', 'flux_lhe', time_avg=True) diag.add_field('mixed_layer', 'flux_t', time_avg=True) diag.add_field('two_stream', 'mars_solar_long', time_avg=True) diag.add_field('two_stream', 'coszen', time_avg=True) diag.add_field('two_stream', 'rrsun', time_avg=True) diag.add_field('two_stream', 'swdn_toa', time_avg=True) diag.add_field('two_stream', 'time_since_ae', time_avg=True) diag.add_field('two_stream', 'true_anomaly', time_avg=True) diag.add_field('two_stream', 'dec', time_avg=True) diag.add_field('two_stream', 'ang', time_avg=True) return diag
def setup_held_suarez_diag(): diag = DiagTable() diag.add_file('atmos_monthly', 30, 'days', time_units='days') # Tell model which diagnostics to write diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'vor', time_avg=True) diag.add_field('dynamics', 'div', time_avg=True) return diag
def define_simple_diag_table(): """Defines a simple diag table for the test cases.""" diag = DiagTable() diag.add_file('atmos_daily', 1, 'days', time_units='days') #Tell model which diagnostics to write diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'vor', time_avg=True) diag.add_field('dynamics', 'div', time_avg=True) return diag
# compilation depends on computer specific settings. The $GFDL_ENV # environment variable is used to determine which `$GFDL_BASE/src/extra/env` file # is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile( ) # compile the source code to working directory $GFDL_WORK/codebase # create an Experiment object to handle the configuration of model parameters # and output diagnostics exp = Experiment('frierson_rotate_slow', codebase=cb) #Tell model how to write diagnostics diag = DiagTable() diag.add_file('atmos_monthly', 30, 'days', time_units='days') #Tell model which diagnostics to write diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('atmosphere', 'precipitation', time_avg=True) diag.add_field('mixed_layer', 't_surf', time_avg=True) diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'vor', time_avg=True) diag.add_field('dynamics', 'div', time_avg=True) exp.diag_table = diag
# $GFDL_BASE and not the checked out git repo. #cb.compile() # compile the source code to working directory $GFDL_WORK/codebase # create an Experiment object to handle the configuration of model parameters # and output diagnostics exp = Experiment(exp_name, codebase=cb) #RF - by default this points the field_table to srcdir/extra/model # this line sets the field table to be in the input_dir #field_table_file='field_table_fv' #exp.field_table_file=os.getcwd()+'/input/'+field_table_file #Tell model how to write diagnostics diag = DiagTable() diag.add_file('4xday', 6, 'hours', time_units='days') #Tell model which diagnostics to write diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('mixed_layer','t_surf', time_avg=True) diag.add_field('mixed_layer','flux_t',time_avg=True) diag.add_field('mixed_layer','flux_lhe',time_avg=True) diag.add_field('atmosphere','precipitation', time_avg=True) if two_stream_option:
# or it can point to a specific git repo and commit id. # This method should ensure future, independent, reproducibility of results. # cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1') # compilation depends on computer specific settings. The $GFDL_ENV # environment variable is used to determine which `$GFDL_BASE/src/extra/env` file # is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile( ) # compile the source code to working directory $GFDL_WORK/codebase # create a diagnostics output file for daily snapshots diag = DiagTable() #for atmos_monthly: 30 'days' in a 'month' multiplied by length of day in seconds diag.add_file('atmos_monthly', 30 * 1379678, 'seconds', time_units='days') #for atmos_daily: length of 'day' in seconds #diag.add_file('atmos_daily', 1379678 , 'seconds', time_units='days') #diag.add_file('atmos_e_daily',1 , 'days', time_units='days') #diag.add_file('atmos_timestep', 240, 'seconds', time_units='days') # Define diag table entries diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk', time_avg=True) diag.add_field('dynamics', 'pk', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True) diag.add_field('dynamics', 'height', time_avg=True)
#qflux_file_name = 'merlis_schneider_30_16' qflux_file_name = 'off' if qflux_file_name != 'off': if not os.path.exists(builddir + '/' + qflux_file_name + '.nc'): shutil.copy( os.environ['GFDL_BASE'] + '/ictp-isca-workshop-2018/experiments/earth_projects/project_5_qfluxes/' + qflux_file_name + '.nc', builddir + '/' + qflux_file_name + '.nc') #Step 4. Define the diagnostics we want to be output from the model print('Step 4: setting output variables') avgflag = True diag = DiagTable() diag.add_file('atmos_monthly', 30, 'days', time_units='days') diag.add_file('atmos_daily', 1, 'days', time_units='days') if 'debug' in todo: debug = True run_ddt = True avgflag = False diag.add_file('atmos_hourly', 1, 'hours', time_units='hours') #NCORES=1 #Tell model which diagnostics to write to those files diag.add_field('dynamics', 'ps', time_avg=avgflag) diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('dynamics', 'zsurf') diag.add_field('dynamics', 'sphum', time_avg=avgflag) diag.add_field('dynamics', 'ucomp', time_avg=avgflag)
# or it can point to a specific git repo and commit id. # This method should ensure future, independent, reproducibility of results. # cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1') # compilation depends on computer specific settings. The $GFDL_ENV # environment variable is used to determine which `$GFDL_BASE/src/extra/env` file # is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile( ) # compile the source code to working directory $GFDL_WORK/codebase # create a diagnostics output file for daily snapshots diag = DiagTable() #diag.add_file('atmos_monthly', 30, 'days', time_units='days') diag.add_file('atmos_daily', 88440, 'seconds', time_units='days') #diag.add_file('atmos_e_daily',1 , 'days', time_units='days') #diag.add_file('atmos_timestep', 240, 'seconds', time_units='days') # Define diag table entries diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk', time_avg=True) diag.add_field('dynamics', 'pk', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True) diag.add_field('dynamics', 'height', time_avg=True) diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('atmosphere', 'precipitation', time_avg=True)
# is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile() # compile the source code to working directory $GFDL_WORK/codebase # create an Experiment object to handle the configuration of model parameters # and output diagnostics exp = Experiment('aquaplanet_finalIscaAPqflux_zerointegral', codebase=cb) #Add any input files that are necessary for a particular experiment. exp.inputfiles = [os.path.join(GFDL_BASE,'input/aquaplanet/land.nc'),os.path.join(GFDL_BASE,'input/rrtm_input_files/ozone_1990.nc'),os.path.join(GFDL_BASE,'input/aquaplanet/isca_qflux/zero_integral/ocean_qflux.nc')] #Tell model how to write diagnostics diag = DiagTable() diag.add_file('atmos_monthly', 30, 'days', time_units='days') # to output data in two different time resolutions # diag.add_file('atmos_6_hourly', 6, 'hours', time_units='hours') #Tell model which diagnostics to write diag.add_field('dynamics', 'ps', time_avg=True) # don't specify files, then it writes to both diag.add_field('dynamics', 'bk') diag.add_field('dynamics', 'pk') diag.add_field('atmosphere', 'precipitation', time_avg=True) diag.add_field('mixed_layer', 't_surf', time_avg=True) diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'vor', time_avg=True) diag.add_field('dynamics', 'div', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True)
# or it can point to a specific git repo and commit id. # This method should ensure future, independent, reproducibility of results. # cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1') # compilation depends on computer specific settings. The $GFDL_ENV # environment variable is used to determine which `$GFDL_BASE/src/extra/env` file # is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile() # compile the source code to working directory $GFDL_WORK/codebase # create a diagnostics output file for daily snapshots diag = DiagTable() # diag.add_file('atmos_monthly', 30, 'days', time_units='days') diag.add_file('atmos_daily',1379678 , 'seconds', time_units='days') #diag.add_file('atmos_e_daily',1 , 'days', time_units='days') #diag.add_file('atmos_timestep', 240, 'seconds', time_units='days') # Define diag table entries diag.add_field('dynamics', 'ps', time_avg=True) diag.add_field('dynamics', 'bk', time_avg=True) diag.add_field('dynamics', 'pk', time_avg=True) diag.add_field('dynamics', 'ucomp', time_avg=True) diag.add_field('dynamics', 'vcomp', time_avg=True) diag.add_field('dynamics', 'temp', time_avg=True) diag.add_field('dynamics', 'omega', time_avg=True) diag.add_field('dynamics', 'height', time_avg=True) diag.add_field('dynamics', 'sphum', time_avg=True) diag.add_field('atmosphere', 'precipitation', time_avg=True)
'mix_snapshot_average_fields': False }, 'fms_nml': { 'domains_stack_size': 600000 # default: 0 }, 'fms_io_nml': { 'threading_write': 'single', # default: multi 'fileset_write': 'single', # default: multi }, }) diag_table = DiagTable() #diag_table.add_file('6hourly', 6*60*60, 'seconds', time_units='days') #diag_table.add_file('hourly', 1, 'hours', time_units='days') diag_table.add_file('daily', 1, 'days', time_units='days') diag_table.add_field('dynamics', 'ps') diag_table.add_field('dynamics', 'bk') diag_table.add_field('dynamics', 'pk') diag_table.add_field('dynamics', 'ucomp') diag_table.add_field('dynamics', 'vcomp') diag_table.add_field('dynamics', 'omega') diag_table.add_field('dynamics', 'temp') diag_table.add_field('dynamics', 'vor') diag_table.add_field('dynamics', 'div') diag_table.add_field('dynamics', 'height') diag_table.add_field('dynamics', 'height_half') diag_table.add_field('hs_forcing', 'teq') diag_table.add_field('hs_forcing', 'tdt')
# or it can point to a specific git repo and commit id. # This method should ensure future, independent, reproducibility of results. # cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1') # compilation depends on computer specific settings. The $GFDL_ENV # environment variable is used to determine which `$GFDL_BASE/src/extra/env` file # is used to load the correct compilers. The env file is always loaded from # $GFDL_BASE and not the checked out git repo. cb.compile( ) # compile the source code to working directory $GFDL_WORK/codebase # create a diagnostics output file for daily snapshots diag = DiagTable() diag.add_file('atmos_daily', 1, 'days', time_units='days') # Define diag table entries diag.add_field('dynamics', 'ps', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'bk', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'pk', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'vor', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'div', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'ucomp', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'vcomp', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'temp', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'slp', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'omega', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'height', time_avg=True, files=['atmos_daily']) diag.add_field('dynamics', 'height_half', time_avg=True, files=['atmos_daily'])