Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UoB Optimisation (Work in progress) #95

Open
wants to merge 103 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
efdf0f7
First attempt at grey mars. Need to add timings before it can really …
sit23 May 11, 2018
a58dafd
Added Alex Paterson's calculation of eccentric anomaly etc to astrono…
sit23 May 11, 2018
07bb7be
Made alternative r_inv_squared subroutine so that we can pass back tr…
sit23 May 11, 2018
2b166e4
Small changes to make mars-solar-long calc more consistent across dif…
sit23 May 11, 2018
387addc
A few extra changes before full long run.
sit23 May 11, 2018
6708bfc
Added extra diagnostics to help with debugging. Problem is that model…
sit23 May 11, 2018
21a7e88
Script for calculating the equilibrium surface temperature for a rang…
sit23 May 15, 2018
9df8af6
Test mars script using lower optical depths.
sit23 May 15, 2018
0593a8a
Was having problems with output from daily averaging as obviously 1 d…
sit23 May 16, 2018
af6df4a
Making option for large scale condensation to be turned on and off in…
sit23 May 18, 2018
1ca7b41
Various updates to mars_dev, includng error checking of surface flux …
sit23 May 29, 2018
30d31d9
Simple script to interpolate mola mars altitude data into topography …
sit23 May 30, 2018
3291452
Model didn't like not having a land mask. Added this now.
sit23 May 30, 2018
4459f5c
Modernising run-plevel.py
sit23 Jun 18, 2018
0be5bed
Found stable configuration of Mars model with stronger sponge.
sit23 Aug 6, 2018
19bc997
Added optin to plevel_fn to add back variables that have the scalar_a…
sit23 Aug 7, 2018
902adbb
Merge branch 'master' into mars_dev
sit23 Sep 7, 2018
b983ac6
Merge branch 'master' into uob_mars_dev
wseviour Dec 15, 2018
fc887d6
Merge branch 'master' into mars_dev
sit23 Jan 28, 2019
256a116
Significant changes to help understand what this does.
sit23 Jan 29, 2019
8eb4ab2
Updating this script to give clearer instructions.
sit23 Jan 29, 2019
7f4201d
Important fix for two-stream. It was operating by calculating the fra…
sit23 Jan 29, 2019
663a695
commented out ntfy package which I don't have
wseviour Feb 4, 2019
3a6944a
Merge remote-tracking branch 'stephen/mars_dev' into uob_mars_dev
wseviour Feb 4, 2019
4013633
added Titan run script and topography file
wseviour Feb 26, 2019
7ff2e97
initial Python scripts
Lancasterg Apr 18, 2019
3bf483b
added compilation script
Lancasterg May 3, 2019
6e5e72e
compile.py
Lancasterg May 3, 2019
8d0a7e1
compile DryCodeBase
Lancasterg Jun 12, 2019
8b30ada
added debug script for held_suarez
Lancasterg Jun 14, 2019
3bbf8f8
minor code changes to allow for compilation
Lancasterg Jun 14, 2019
66a4a47
patch changes from isambard_dev
Lancasterg Jun 14, 2019
11171ac
minor changes to enable execution on isambard
Lancasterg Jun 18, 2019
6702422
environment file mppncombine
Jun 19, 2019
d0157fa
add grey mars test to benchmarking
Jun 20, 2019
e0264cc
minor modifications
Lancasterg Jun 20, 2019
b1df98f
update mkmf templating / delete redundant files
Lancasterg Jun 24, 2019
c958c5d
create environment file for BP
Jun 26, 2019
84661ea
debugging output
Lancasterg Jun 30, 2019
08824aa
modifications to run with cray-GNU
Lancasterg Jul 3, 2019
81c5999
Cray gfortran configuration
Lancasterg Jul 4, 2019
ebd82cd
Add preprocessor directives for monin_obukhov_kernel
Lancasterg Jul 4, 2019
caaaa1d
delete benchmarking folder
Lancasterg Jul 11, 2019
bf16b27
remove comp.F90 from wrong folder
Lancasterg Jul 11, 2019
1bb680a
delete unwanted changes to giant_planet_test_case.py
Lancasterg Jul 11, 2019
178e999
Revert to original file
Lancasterg Jul 11, 2019
8d8bda2
Revert debugging clause
Lancasterg Jul 11, 2019
5e6f78f
Revert comments in run.sh template
Lancasterg Jul 11, 2019
81d2ea5
Revert mkmf.template.gfort
Lancasterg Jul 11, 2019
e161556
Merge pull request #1 from Lancasterg/isambard_dev_gnu
Lancasterg Jul 11, 2019
c8b52e0
Delete benchmarking folder
Lancasterg Jul 11, 2019
0b461b7
add macro to fix logical conversion to integer
Lancasterg Jul 11, 2019
32287f6
Place -alpha in brackets
Lancasterg Jul 11, 2019
3a466a7
Cray compiler complains about lack of then statement
Lancasterg Jul 11, 2019
9a461b4
Addition of iv_floor_int variable - Cray compiler complains of use of…
Lancasterg Jul 11, 2019
09111dc
Merge branch 'uob_benchmarking' into isambard_dev_2
Lancasterg Jul 11, 2019
ccd19a0
Revert time_avg
Lancasterg Jul 11, 2019
fa78e66
Revert overwrite_data=True
Lancasterg Jul 11, 2019
f2971b0
Revert Ncores=8
Lancasterg Jul 11, 2019
95fb979
Revert (DIM) and add TODO
Lancasterg Jul 11, 2019
ec22558
Remove redundant comments
Lancasterg Jul 11, 2019
7fdb44a
Delete redundant comments
Lancasterg Jul 11, 2019
b089f61
Delete debugging print statement
Lancasterg Jul 11, 2019
8790782
Revert dubugging clause
Lancasterg Jul 11, 2019
c61130c
Remove redundant comments
Lancasterg Jul 11, 2019
a5a9465
Merge pull request #2 from Lancasterg/isambard_dev_2
Lancasterg Jul 11, 2019
3f4d70f
delete old mkmf files
Lancasterg Jul 11, 2019
65e8ebd
preparation for merge with uob_benchamrking
Jul 11, 2019
2078dfd
Check whether it is safe to purge
Lancasterg Jul 11, 2019
04067d3
Merge pull request #3 from Lancasterg/bcp3_dev
Lancasterg Jul 11, 2019
18255b3
bluepebble environment file
Jul 11, 2019
4c49fcf
undefine MPP_GATHER_1DV_ to remove warning
Lancasterg Jul 11, 2019
2bed068
Merge branch 'uob_benchmarking' of https://github.com/Lancasterg/Isca…
Lancasterg Jul 11, 2019
0386efd
Merge pull request #4 from Lancasterg/bp1_dev
Lancasterg Jul 12, 2019
c8ad0da
comment out debugging line
Jul 14, 2019
de50c43
remove warnings
Lancasterg Jul 17, 2019
16a48aa
merge
Lancasterg Jul 17, 2019
cd90f40
addition of fftw
Lancasterg Jul 19, 2019
ff9cab6
Fixed bugs in fftw - fftw now works as expected
Lancasterg Jul 23, 2019
f2484d5
reverse_transpose_fourier #WIP
Lancasterg Jul 27, 2019
97b8235
asynch irecv
Lancasterg Jul 27, 2019
c880667
floating point precision for fftw
Lancasterg Aug 7, 2019
3579f18
floating point precision for fftw
Lancasterg Aug 7, 2019
096733b
fftw for bcp3
Aug 7, 2019
1a7b297
resolve merge conflicts
Aug 7, 2019
c34a6cd
Merge branch 'uob_fftw' of https://github.com/Lancasterg/Isca into uo…
Lancasterg Aug 7, 2019
b9b509d
update environment files for isambard
Lancasterg Aug 24, 2019
719dab1
merge compile.sh
Lancasterg Aug 24, 2019
cca8938
create isca_fftw directory
Lancasterg Aug 24, 2019
b67926f
delete old templates
Lancasterg Aug 24, 2019
2b78075
default to double precision
Lancasterg Aug 28, 2019
55daba8
Merge branch 'uob_fftw' of https://github.com/Lancasterg/Isca into uo…
Lancasterg Aug 28, 2019
e65fa79
python script for fftw
Lancasterg Aug 29, 2019
cdb50df
revert BCP4 to default files
Lancasterg Aug 29, 2019
4946cf1
merge compile.sh
Lancasterg Aug 29, 2019
00f18af
add readme for held_suarez_fftw
Lancasterg Aug 29, 2019
f240537
add bluepebble job
Aug 29, 2019
01c9574
Merge branch 'uob_fftw' of https://github.com/Lancasterg/Isca into uo…
Aug 29, 2019
fadc19a
fftw readme
Aug 29, 2019
dd4dc99
documentation for bluepebble
Aug 29, 2019
f3d90b3
import DryCodeBaseFFTW
Aug 29, 2019
a4d6967
Add FFTW codebase to cobebase.py
Sep 8, 2019
99f1939
remove old template file
Lancasterg Sep 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ src/extra/python/scripts/*.nc
src/extra/python/scripts/archived/
mima_pz.txt
test/.cache
test/results.xml
test/results.xml
.vscode
245 changes: 245 additions & 0 deletions exp/grey_mars/grey_mars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
import numpy as np

from isca import IscaCodeBase, GreyCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE
from isca.util import exp_progress
#from ntfy import notify

NCORES = 16

# a CodeBase can be a directory on the computer,
# useful for iterative development
cb = GreyCodeBase.from_directory(GFDL_BASE)
# cb = GreyCodeBase.from_repo(repo='git@github.com:sit23/Isca.git', commit='7145be9')

# 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)

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)

# define namelist values as python dictionary
namelist = Namelist({
'main_nml': {
'dt_atmos': 110,
'days': 0,
'seconds': 30*88440,
'calendar': 'no_calendar'
},

'idealized_moist_phys_nml': {
'do_damping': True,
'turb':True,
'mixed_layer_bc':True,
'do_virtual' :False,
'do_simple': True,
'roughness_mom':3.21e-05,
'roughness_heat':3.21e-05,
'roughness_moist':0.,
'two_stream_gray': True, #Use grey radiation
'do_lscale_cond': False,
},

'vert_turb_driver_nml': {
'do_mellor_yamada': False, # default: True
'do_diffusivity': True, # default: False
'do_simple': True, # default: False
'constant_gust': 0.0, # default: 1.0
'use_tau': False
},

'diffusivity_nml': {
'do_entrain':False,
'do_simple': True,
},

'surface_flux_nml': {
'use_virtual_temp': False,
'do_simple': True,
'old_dtaudv': True,
'use_actual_surface_temperatures':False,
},

'atmosphere_nml': {
'idealized_moist_model': True
},

'mixed_layer_nml': {
'tconst' : 285.,
'prescribe_initial_dist':True,
'evaporation':False,
'albedo_value': 0.3,
},

'qe_moist_convection_nml': {
'rhbm':0.0,
'tau_bm':3600.,
},

'dry_convection_nml': {
'tau':7200,
},

'betts_miller_nml': {
'rhbm': .7 ,
'do_simp': False,
'do_shallower': True,
},

'lscale_cond_nml': {
'do_simple':True,
'do_evap':True
},

'sat_vapor_pres_nml': {
'do_simple':True,
'tcmin': -223, #Make sure low temperature limit of saturation vapour pressure is low enough that it doesn't cause an error (note that this giant planet has no moisture anyway, so doesn't directly affect calculation.
'tcmax': 350.,
},

'damping_driver_nml': {
'do_rayleigh': True,
'trayfric': -0.125, # neg. value: time in *days*
'sponge_pbottom': 0.5, #Bottom of the model's sponge down to 50hPa (units are Pa)
'do_conserve_energy': True,
},

'spectral_dynamics_nml': {
'num_levels': 25,
'exponent': 2.5,
'scale_heights': 4,
'surf_res': 0.1,
'robert_coeff': 4e-2,
'do_water_correction': False,
'vert_coord_option': 'input',
'initial_sphum': 0.,
'valid_range_T': [0, 700]
},

'vert_coordinate_nml': {
'bk': [ 0.00000000e+00, 1.53008955e-04, 4.63790800e-04, 1.10977640e-03, 2.37044150e-03, 4.74479200e-03, 9.12245300e-03, 1.70677050e-02, 3.12516100e-02, 5.59939500e-02, 9.76165000e-02, 1.63754900e-01, 2.60315150e-01, 3.85974250e-01, 5.28084800e-01, 6.65956600e-01, 7.81088000e-01, 8.65400050e-01, 9.21109250e-01, 9.55343500e-01, 9.75416950e-01, 9.86856800e-01, 9.93269300e-01, 9.96830200e-01, 9.98799150e-01, 1.00000000e+00],
'pk': [0.]*26,
},

'two_stream_gray_rad_nml': {
'rad_scheme': 'frierson', #Select radiation scheme to use, which in this case is Frierson
'do_seasonal': True,
'atm_abs': 0.2,
'sw_diff':0.0,
'ir_tau_eq':0.2,
'ir_tau_pole':0.2,
'linear_tau': 1.0,
'equinox_day':0.0,
'use_time_average_coszen':True,
'solar_constant':589.0,
},


# configure the relaxation profile
# 'hs_forcing_nml': {
# 'equilibrium_t_option' : 'top_down',
# 'ml_depth': 10.,
# 'spinup_time': 108000,
# 'ka': -2.,
# 'ks': -2.,
# 'tau_s': 0.2,
# 'calculate_insolation_from_orbit' : True,
# 'do_rayleigh_damping':False,
# 'albedo':0.25,
# 'pure_rad_equil':True,
# 'stratosphere_t_option':'pure_rad_equil',
# 'peri_time': 0.,
# 'h_a': 10.8,
# 'use_olr_from_t_surf':True,
# 'frac_of_year_ae':0.3032894472101727,
# },

'astronomy_nml': {
'ecc':0.0935,
'obliq':25.19,
'use_mean_anom_in_rrsun_calc':True,
'use_old_r_inv_squared':False
},

'constants_nml': {
'orbital_period': 59166360,
'solar_const':589.0,
'radius':3396.0e3,
'rdgas':192.0,
'kappa':0.22727,
'rotation_period':88308,
},

})

if __name__=="__main__":

conv_schemes = ['none']

depths = [2.]

pers = [70.85]

scale = 1.

for conv in conv_schemes:
for depth_val in depths:
for per_value in pers:
exp = Experiment('grey_mars_mk36_per_value'+str((per_value))+'_'+conv+'_mld_'+str(depth_val), codebase=cb)
exp.clear_rundir()

exp.diag_table = diag
exp.namelist = namelist.copy()
exp.namelist['constants_nml']['grav'] = scale * 3.71
exp.namelist['constants_nml']['pstd'] = scale * 6100.0
exp.namelist['constants_nml']['pstd_mks'] = scale * 610.0
exp.namelist['spectral_dynamics_nml']['reference_sea_level_press'] = scale * 610.0
exp.namelist['idealized_moist_phys_nml']['convection_scheme'] = conv
exp.namelist['mixed_layer_nml']['depth'] = depth_val
exp.namelist['astronomy_nml']['per'] = per_value

# with exp_progress(exp, description='o%.0f d{day}' % scale):
exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2, 241):
# with exp_progress(exp, description='o%.0f d{day}' % scale):
exp.run(i, num_cores=NCORES)
# notify('top down with conv scheme = '+conv+' has completed', 'isca')
Loading