-
Notifications
You must be signed in to change notification settings - Fork 3
gcm_setup python conversion #602
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
Draft
sshakoor1
wants to merge
63
commits into
feature/sdrabenh/gcm_v12
Choose a base branch
from
feature/sshakoor/gcmpy
base: feature/sdrabenh/gcm_v12
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
4147127
initial commit
9355426
updated directories
0e5e3af
Add scripts via upload
sshakoor1 6361d50
Add yaml files via upload
sshakoor1 e13a1f5
Update gcmpy/CMakeLists.txt
sshakoor1 6f84181
CMakeLists changes
1eca15f
resolving conflict
bd64abf
storing to switch branches
51e2002
commit to switch branches
4a95c49
dir setup
71bc462
merging develop into feature/sshakoor/gcmpy
230641b
stashing for a moment
824e8f5
template files were modified to be compatible with jinja2. AMIP exper…
dcfeaec
AMIP experiments trivial zero diff
9d1b8f9
Delete gcmpy/sync.sh
sshakoor1 2a003da
Delete gcmpy/jinjafy.py
sshakoor1 a4e0e80
Delete gcmpy/scripts/__pycache__ directory
sshakoor1 7a2187b
revamped ocean script and other minor bug fixes
8d4c2d2
Merge remote-tracking branch 'origin/feature/sshakoor/gcmpy' into fea…
62bcafa
gcm_v12 update
5320e33
fixed CMakeLists.txt and updated gitignore
db7ea6c
Fixed some template variables still using old format + SSTNAME gets t…
2bbb74c
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 b4a94fc
Move @ to braces
mathomp4 d2ed1c9
Fix bad merge again
mathomp4 ba0eb57
fixed out_bc_base not being templated in gcm_run.j
7e84bd9
Merge branch 'feature/sdrabenh/gcm_v12' into merge-v12-into-gcmpy
mathomp4 42fb65f
Add several_tries and new PSM env to python
mathomp4 1152b0f
big gcm_v12 update
d02a7db
updated cmakelists for CFG_INSTALL_SOURCE_TARFILE
67b54d9
Restore some missing changes
mathomp4 6e32166
Fix bad change
mathomp4 151eae1
Updates to history
mathomp4 09636f4
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 9177c7f
Satisfy yamllint
mathomp4 f3a50fa
Trivial commit to test CI
mathomp4 d84d2f0
Make scm like gcm
mathomp4 789d0f2
Add shebang to gcm_setup.py
mathomp4 33edb2d
Turn off exp description different from exp id for now
mathomp4 1983bf1
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 a51fb18
new dt changes, CLIM_IM/JM, ice_in regex subsitution
bbbc89e
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 9159095
Add c
mathomp4 eb888db
updated resolutions (v12 match)
adf6602
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 4dbdfad
Add comment about I_MPI_JOB_RESPECT_PROCESS_PLACEMENT
mathomp4 5afff0f
Added YAML cloning functionality, major refactoring, and v12 bcs_inpu…
9bfc71c
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 07704a6
make o2 default at low res
mathomp4 756dd21
low_res atmos means restart_by_oserver=true for MPT
mathomp4 e482645
remove swp file
8d27eef
changed yaml cloning to yaml input via cmd line flag
bce7dc8
Added old cloning
c4bc6eb
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 b725074
Add in Turin bits from v12
mathomp4 2340e59
Merge branch 'feature/v12-scm-tinybcs' into feature/sshakoor/gcmpy
mathomp4 201e443
Fixes for scm
mathomp4 94a6aa0
Fix weird GFDL_1M set
mathomp4 e099f79
Fix for ocean
mathomp4 53afccc
Update dt from v12
mathomp4 09f8717
small fixes for desktop
mathomp4 b905b51
Merge branch 'feature/sdrabenh/gcm_v12' into feature/sshakoor/gcmpy
mathomp4 ac17e2e
fix bad merge
mathomp4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| add_subdirectory(gcmpy) | ||
|
|
||
| ecbuild_add_executable ( | ||
| TARGET GEOSgcm.x | ||
| SOURCES GEOSgcm.F90 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # cp (makes exe) | ||
| add_subdirectory(scripts) | ||
| add_subdirectory(yamls) | ||
|
|
||
| set (programs) | ||
|
|
||
| install ( | ||
| PROGRAMS ${programs} | ||
| DESTINATION bin/gcmpy | ||
| ) | ||
|
|
||
| # processed files | ||
| set (setup_scripts) | ||
|
|
||
| foreach (file ${setup_scripts}) | ||
| configure_file(${file} ${file} @ONLY) | ||
| install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin/gcmpy) | ||
| endforeach () | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| set (programs | ||
| #fill | ||
| ) | ||
|
|
||
| install ( | ||
| PROGRAMS ${programs} | ||
| DESTINATION bin/gcmpy/scripts | ||
| ) | ||
|
|
||
| # processed files | ||
| set (setup_scripts) | ||
|
|
||
| foreach (file ${setup_scripts}) | ||
| configure_file(${file} ${file} @ONLY) | ||
| install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${file} DESTINATION bin/gcmpy) | ||
| endforeach () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,333 @@ | ||
| from env import answerdict | ||
| from utility import color | ||
|
|
||
| class atmosphere: | ||
| def __init__(self): | ||
| self.use_SHMEM = False | ||
| self.force_das = "#" | ||
| self.force_gcm = "#" | ||
| self.num_readers = 1 | ||
| self.num_writers = 1 | ||
| self.DT = answerdict["heartbeat"].q_answer | ||
| self.DT_solar = None | ||
| self.DT_irrad = None | ||
| self.DT_ocean = None | ||
| self.DT_long = None | ||
| self.IM = int(answerdict["AM_horizontal_res"].q_answer[1:]) | ||
| self.JM = self.IM * 6 | ||
| self.NX = None | ||
| self.NY = None | ||
| self.use_hydrostatic = answerdict["use_hydrostatic"].q_answer | ||
| self.microphysics = answerdict["AM_microphysics"].q_answer | ||
| self.IM_hist = self.IM * 4 | ||
| self.JM_hist = self.JM * 2 + 1 | ||
| self.gridfile = f"Gnomonic_c{self.IM}.dat" | ||
| self.job_sgmt = None | ||
| self.num_sgmt = None | ||
| self.res = f"CF{self.IM:04}x6C" | ||
| self.post_NDS = None | ||
| self.NX_convert = 2 | ||
| self.NY_convert = 24 | ||
| self.CONUS = "#" | ||
| self.stretch_factor = None | ||
| self.gridname = f"PE{self.IM}x{self.JM}-CF" | ||
| self.res_dateline = f"{self.IM}x{self.JM}" | ||
| self.BACM_1M = "#" | ||
| self.GFDL_1M = "#" | ||
| self.MGB2_2M = "#" | ||
| self.GFDL_hydro = ".TRUE." | ||
| self.GFDL_prog_ccn = "prog_ccn = .true." | ||
| self.GFDL_use_ccn = "use_ccn = .true." | ||
| self.MP_turnoff_wsub = None | ||
| self.FV_make_NH = None | ||
| self.FV_hydro = None | ||
| self.schmidt = None | ||
| self.target_lon = None | ||
| self.target_lat = None | ||
|
|
||
| # for debugging purposes | ||
| def print_vars(self): | ||
| all_vars = vars(self) | ||
| for var_name, var_value in all_vars.items(): | ||
| print(f"{color.BLUE}{var_name}: {var_value}{color.RESET}") | ||
|
|
||
| def hres(self, ocean_NX, ocean_NY): | ||
| match answerdict["AM_horizontal_res"].q_answer: | ||
| case "c12": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| if answerdict["OM_name"].q_answer == "MOM6": | ||
| self.NX = 1 | ||
| else: | ||
| self.NX = 2 | ||
| self.NY = self.NX * 6 | ||
| self.job_sgmt = f"{15:08}" | ||
| self.num_sgmt = 20 | ||
| self.post_NDS = 4 | ||
| self.NX_convert = 1 | ||
| self.NY_convert = 6 | ||
|
|
||
| case "c24": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| self.NX = 4 | ||
| self.NY = self.NX * 6 | ||
| self.job_sgmt = f"{15:08}" | ||
| self.num_sgmt = 20 | ||
| self.post_NDS = 4 | ||
| self.NX_convert = 1 | ||
| self.NY_convert = 6 | ||
|
|
||
| case "c48": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| self.NX = 4 | ||
| self.NY = self.NX * 6 | ||
| self.IM_hist = 180 | ||
| self.JM_hist = 91 | ||
| self.job_sgmt = f"{15:08}" | ||
| self.num_sgmt = 20 | ||
| self.post_NDS = 4 | ||
|
|
||
| case "c90": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_long = self.DT | ||
| match answerdict["OM_name"].q_answer: | ||
| case "MIT": | ||
| self.NX = 10 | ||
| self.NY = 36 | ||
| self.DT_ocean = self.DT | ||
| case "MOM5","MOM6": | ||
| self.NX = ocean_NX | ||
| self.NY = ocean_NY | ||
| self.DT_ocean = self.DT | ||
| case _: | ||
| self.NX = 3 | ||
| self.NY = self.NX * 6 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.job_sgmt = f"{32:08}" | ||
| self.num_sgmt = 4 | ||
| self.post_NDS = 8 | ||
|
|
||
| case "c180": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_long = self.DT | ||
| if answerdict["OM_coupled"].q_answer == True: | ||
| self.NX = ocean_NX | ||
| self.NY = ocean_NY | ||
| self.DT_ocean = self.DT | ||
| else: | ||
| self.NX = 6 | ||
| self.NY = self.NX * 6 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.job_sgmt = f"{16:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 8 | ||
| self.num_readers = 2 | ||
|
|
||
| case "c360": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| self.NX = 12 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 4 | ||
| self.job_sgmt = f"{5:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 12 | ||
| self.NX_convert = 4 | ||
|
|
||
| case "c720": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 450 | ||
| self.NX = 24 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{5:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 16 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
|
|
||
| case "c1440": | ||
| self.DT_solar = 1800 | ||
| self.DT_irrad = 1800 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 48 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
|
|
||
| case "c2880": | ||
| self.DT_solar = 1800 | ||
| self.DT_irrad = 1800 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 96 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
|
|
||
| case "c5760": | ||
| self.DT_solar = 900 | ||
| self.DT_irrad = 900 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 192 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
|
|
||
| case "c270": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| self.NX = 18 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
| self.CONUS = "" | ||
| self.stretch_factor = 2.5 | ||
|
|
||
| case "c540": | ||
| self.DT_solar = 3600 | ||
| self.DT_irrad = 3600 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = self.DT | ||
| self.NX = 36 | ||
| self.NY = self.NX * 6 * 2 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
| self.CONUS = "" | ||
| self.stretch_factor = 2.5 | ||
|
|
||
| case "c1080": | ||
| self.DT_solar = 900 | ||
| self.DT_irrad = 900 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 72 | ||
| self.NY = self.NX * 6 * 2 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{1:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
| self.CONUS = "" | ||
| self.stretch_factor = 2. | ||
|
|
||
| case "c1536": | ||
| self.DT_solar = 900 | ||
| self.DT_irrad = 900 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 96 | ||
| self.NY = self.NX * 6 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{5:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 16 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
| self.CONUS = "" | ||
| self.stretch_factor = 3.0 | ||
|
|
||
| case "c2160": | ||
| self.DT_solar = 900 | ||
| self.DT_irrad = 900 | ||
| self.DT_ocean = self.DT_irrad | ||
| self.DT_long = 300 | ||
| self.NX = 192 | ||
| self.NY = self.NX * 6 * 2 | ||
| self.num_readers = 6 | ||
| self.job_sgmt = f"{5:08}" | ||
| self.num_sgmt = 1 | ||
| self.post_NDS = 32 | ||
| self.NX_convert = 8 | ||
| self.use_SHMEM = True | ||
| self.CONUS = "" | ||
| self.stretch_factor = 2.5 | ||
|
|
||
| if answerdict["OM_name"].q_answer == "MIT": | ||
| self.DT_ocean = self.DT | ||
|
|
||
| def set_microphysics(self): | ||
| match self.microphysics: | ||
| case "BACM_1M": | ||
| self.BACM_1M = "" | ||
| self.DT_long = 450 | ||
| case "GFDL_1M": | ||
| self.GFDL_1M = "" | ||
| case "MGB2_2M": | ||
| self.MGB2_2M = "" | ||
|
|
||
| def set_turnoff_wsub(self): | ||
| if self.microphysics == "MGB2_2M": | ||
| self.MP_turnoff_wsub = "#DELETE" | ||
| else: | ||
| self.MP_turnoff_wsub = "" | ||
|
|
||
| # settings for fvcore_layour.rc | ||
| def set_fvcore_layout(self): | ||
| match self.use_hydrostatic: | ||
| case True: | ||
| self.FV_make_NH = "Make_NH = .F." | ||
| self.FV_hydro = "hydrostatic = .T." | ||
| case False: | ||
| self.FV_make_NH = "Make_NH = .T." | ||
| self.FV_hydro = "hydrostatic = .F." | ||
| if self.microphysics == "MGB2_2M": | ||
| self.FV_hydro = ".FALSE." | ||
|
|
||
| def set_CONUS(self): | ||
| if self.CONUS == "#": | ||
| self.schmidt = "do_schmidt = .false." | ||
| self.stretch_factor = "stretch_fac = 1.0" | ||
| self.target_lon = "target_lon = 0.0" | ||
| self.target_lat = "target_lat = 0.0" | ||
| else: | ||
| self.schmidt = "do_schmidt = .true." | ||
| self.stretch_factor = "stretch_fac = $STRETCH_FACTOR" | ||
| self.target_lon = "target_lon = -98.35" | ||
| self.target_lat = "target_lat = 39.5" | ||
|
|
||
|
|
||
| def config(self, ocean_NX, ocean_NY): | ||
| self.hres(ocean_NX, ocean_NY) | ||
| self.set_microphysics() | ||
| self.set_fvcore_layout() | ||
| self.set_CONUS() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.