Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e0d8ea7
updated stretched cube input options for upper restarts
wmputman Jan 31, 2024
795a83c
Merge branch 'main' into feature/wmputman/remap_upper_stretched_cube_in
weiyuan-jiang Feb 21, 2024
514bc38
Merge branch 'main' into feature/wjiang/bill_remap_upper_stretched_cu…
weiyuan-jiang Feb 21, 2024
176e0de
change log
weiyuan-jiang Feb 21, 2024
f4b0c94
Merge branch 'main' into feature/wjiang/bill_remap_upper_stretched_cu…
biljanaorescanin Feb 26, 2024
2815bfd
Update remap_command_line.py
weiyuan-jiang Feb 26, 2024
23ecea5
major updates for upper_air restart regrid/remap to fix vector regrid…
wmputman Mar 5, 2024
861fb79
Merge branch 'feature/wmputman/KM_v11_5_1_remap_upper' into feature/w…
weiyuan-jiang Mar 7, 2024
7cf1841
added hydrostatic question and blank qos choice
weiyuan-jiang Mar 9, 2024
44dc2f7
Merge branch 'main' into feature/wjiang/bill_remap_upper_stretched_cu…
weiyuan-jiang Apr 1, 2024
d988c67
more clear message fo hydrostatic
weiyuan-jiang Apr 1, 2024
eb8625e
cleanup in/out grids and print values
wmputman Apr 5, 2024
7cf4ae1
Merge branch 'main' into feature/wmputman/KM_v11_5_1_remap_upper
sdrabenh Apr 5, 2024
8dd4e92
Merge branch 'main' into feature/wjiang/bill_remap_upper_stretched_cu…
biljanaorescanin Apr 8, 2024
b4a374e
needed ENV variables for OpenMPI and IntelMPI on Milan nodes
wmputman Apr 10, 2024
98f9ea6
Merge remote-tracking branch 'origin/feature/wjiang/bill_remap_upper_…
sdrabenh Apr 12, 2024
e9c1aff
Merge remote-tracking branch 'origin/feature/wmputman/KM_v11_5_1_rema…
sdrabenh Apr 26, 2024
08236f8
Merge remote-tracking branch 'origin/main' into feature/sdrabenh/gcm_…
sdrabenh Jun 7, 2024
0cc57e8
Merge remote-tracking branch 'origin/main' into feature/sdrabenh/gcm_…
sdrabenh Jun 11, 2024
d29629b
Merge remote-tracking branch 'origin/main' into feature/sdrabenh/gcm_v12
sdrabenh Aug 14, 2024
83389cf
v12: Fix for SLES15 remapping
mathomp4 Sep 12, 2024
f2f4f3c
Fix CI
mathomp4 Sep 12, 2024
891e249
Merge pull request #97 from GEOS-ESM/bugfix/mathomp4/v12-remapping
mathomp4 Sep 12, 2024
7f43f62
hand-merge main into feature/sdrabenh/gcm_v12
sdrabenh Oct 3, 2024
68b5752
Merge remote-tracking branch 'origin/main' into feature/sdrabenh/gcm_v12
sdrabenh Oct 8, 2024
539c82c
hand-merge main into feature/sdrabenh/gcm_v12
sdrabenh Dec 11, 2024
45d0355
add missing commits
biljanaorescanin Jan 3, 2025
f704f69
fix the indentation
biljanaorescanin Jan 3, 2025
130e729
typo
biljanaorescanin Jan 3, 2025
dd16e76
remove scutest
biljanaorescanin Jan 3, 2025
175d777
add message for restart file names
weiyuan-jiang Jan 3, 2025
141ed37
update user message
biljanaorescanin Jan 6, 2025
ee4378f
fix for hydrostatic option in remap questions
wmputman Jan 29, 2025
dbbfe57
Merge pull request #116 from GEOS-ESM/feature/borescan_fix_v12_branch
sdrabenh Feb 6, 2025
6a76b63
Hand-merge missing GEOSIT condition in remap_questions.py
sdrabenh Feb 6, 2025
2e13338
Hand merge main into feature/sdrabenh/gcm_v12
sdrabenh Feb 7, 2025
3b561da
v12: Add support for v13 bcs in remap
mathomp4 Feb 11, 2025
553a820
v12: Remove NCCS OS detection
mathomp4 Mar 25, 2025
9ebc180
Update changelog
mathomp4 Mar 25, 2025
40e0476
resolved issue #131 in gcm_v12
Apr 14, 2025
248f714
Fix bug with MERRA2 remapping
mathomp4 Apr 15, 2025
3562ff0
Merge pull request #132 from GEOS-ESM/feature/gcm_v12/#131-remap_rest…
sdrabenh Apr 15, 2025
b633d82
hand-merge develop into feature/sdrabenh/gcm_v12 on 20250424
sdrabenh Apr 24, 2025
bc29f02
Merge pull request #138 from GEOS-ESM/feature/sdrabenh/dev_into_v12_2…
sdrabenh Apr 25, 2025
1d68704
v12: Fix saltsplit bug
mathomp4 Jun 13, 2025
bcd66fc
confocn.py and plotocn.j jinja compatability
Jul 29, 2025
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
13 changes: 8 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version: 2.1

# Anchors in case we need to override the defaults from the orb
#baselibs_version: &baselibs_version v7.29.0
#bcs_version: &bcs_version v11.6.0
#baselibs_version: &baselibs_version v8.5.0
#bcs_version: &bcs_version v12.0.0

orbs:
ci: geos-esm/circleci-tools@4
ci: geos-esm/circleci-tools@5

workflows:
build-test:
Expand All @@ -21,7 +21,10 @@ workflows:
#baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
# V12 code uses a special branch for now.
fixture_branch: feature/sdrabenh/gcm_v12
# We comment out this as it will "undo" the fixture_branch
#mepodevelop: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra

# Run AMIP GCM (1 hour, no ExtData)
Expand All @@ -45,7 +48,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [ifort]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added choice 'blank' for qos in remap_restart python pacakage
- Added hydrostatic question in remap_restart python pacakage
- Added function to remap from stretched restarts to stretched restarts
- Added remapping for GEOS-IT restarts
- Added new res C1120
- NOTE: If running on SLES15 remap tests will not be zero diff for GOCART RST but are zero diff for all other
- Add support for v13 BCs

### Changed

### Fixed

- Fixed issue with SLES15 in remapping

### Removed

- Removed detection of OS at NCCS as it is all SLES15 now

### Deprecated

## [2.1.7] - 2025-04-23
Expand Down
12 changes: 6 additions & 6 deletions coupled_diagnostics/g5lib/confocn.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'''
@EXPDSC
{{ EXPDSC }}

### Put detailed experiment description here ###
'''
import os
from datetime import date

expid='@EXPID'
cmpexp='@EXPID'
data_path='@EXPDIR'
expid='{{ EXPID }}'
cmpexp='{{ EXPID }}'
data_path='{{ EXPDIR }}'
plot_path=data_path+'/plots_ocn'
basin_mask='@COUPLEDIR/basin_mask/@OGCM_IMx@OGCM_JM/basin_mask.nc'
grid_spec='@COUPLEDIR/a@AGCM_IMx@AGCM_JM_o@OGCM_IMx@OGCM_JM/INPUT/grid_spec.nc'
basin_mask='{{ COUPLEDIR }}/basin_mask/{{ OGCM_IM }}x{{ OGCM_JM }}/basin_mask.nc'
grid_spec='{{ COUPLEDIR }}/a{{ AGCM_IM }}x{{ AGCM_JM }}_o{{ OGCM_IM }}x{{ OGCM_JM }}/INPUT/grid_spec.nc'

start_year=1980
end_year=1981
Expand Down
10 changes: 5 additions & 5 deletions coupled_diagnostics/g5lib/plotocn.j
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/csh
#SBATCH --job-name=@PLOT_T
#SBATCH --job-name={{ PLOT_T }}
#SBATCH --ntasks=20
#SBATCH --time=12:00:00
#SBATCH -o plotocn.out

source /usr/share/modules/init/csh
module purge
module load python/GEOSpyD/Ana2019.10_py2.7
set SCRDIR=@GEOSDIR/coupled_diagnostics
set SCRDIR={{ GEOSDIR }}/coupled_diagnostics
set G5LIBDIR=$SCRDIR
set ANADIR=$SCRDIR/analysis
set VERIFICATION=$SCRDIR/verification
Expand All @@ -18,9 +18,9 @@ else if ( ($HOSTNAME =~ "pfe"*) || ($HOSTNAME =~ r[0-9]*i[0-9]*n[0-9]*) || ($HOS
setenv OCEANVAL /nobackup/gmao_SIteam/ModelData/oceanval/verification
endif

set EXPID=@EXPID
set HOMDIR=@HOMDIR
set EXPDIR=@EXPDIR
set EXPID={{ EXPID }}
set HOMDIR={{ HOMDIR }}
set EXPDIR={{ EXPDIR }}
set WORKDIR=$EXPDIR/plot

setenv PYTHONPATH ${G5LIBDIR}:${VERIFICATION}:${HOMDIR}/..
Expand Down
12 changes: 10 additions & 2 deletions post/stats.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,16 @@ end subroutine init_levs
zlev(lev).eq.750 .or. zlev(lev).eq.600 .or. &
zlev(lev).eq.500 .or. zlev(lev).eq.400 .or. &
zlev(lev).eq.300 .or. zlev(lev).eq.200 .or. &
zlev(lev).eq.100 .or. zlev(lev).eq.70 .or. &
zlev(lev).eq.30 .or. zlev(lev).eq.10 ) then
zlev(lev).eq.100 .or. zlev(lev).eq.90 .or. &
zlev(lev).eq.80 .or. zlev(lev).eq.70 .or. &
zlev(lev).eq.60 .or. zlev(lev).eq.50 .or. &
zlev(lev).eq.40 .or. zlev(lev).eq.30 .or. &
zlev(lev).eq.20 .or. zlev(lev).eq.10 .or. &
zlev(lev).eq.9 .or. zlev(lev).eq.8 .or. &
zlev(lev).eq.7 .or. zlev(lev).eq.6 .or. &
zlev(lev).eq.5 .or. zlev(lev).eq.4 .or. &
zlev(lev).eq.3 .or. zlev(lev).eq.2 .or. &
zlev(lev).eq.1 ) then
write(6,1005) int(zlev(lev)),trim(regions(iregion)),&
trim(fields_3d(n)%name),nymd,nhms,hour,&
rms(iregion,lev,nfield,nt,1),&
Expand Down
27 changes: 26 additions & 1 deletion pre/NSIDC-OSTIA_SST-ICE_blend/regrid_forcing_esmf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ module GenESMFGridCompMod
integer :: PJM
integer :: GPIM
integer :: GPJM
integer :: OIM
integer :: OJM
integer :: GOIM
integer :: GOJM
type(ESMF_Time) :: start_time
type(ESMF_Time) :: end_time
logical :: select_time
Expand Down Expand Up @@ -277,6 +281,15 @@ subroutine Initialize ( GC, IMPORT, EXPORT, CLOCK, RC )
PrivateState%ogrid=ogrid
PrivateState%pgrid=pgrid

! Query Ogrid to save IM and JM
call MAPL_GridGet(ogrid, localCellCountPerDim=COUNTS, &
globalCellCountPerDim=dims, RC=STATUS)
VERIFY_(STATUS)
PrivateState%oim=counts(1)
PrivateState%ojm=counts(2)
PrivateState%goim=dims(1)
PrivateState%gojm=dims(2)

! Query Pgrid to save IM and JM
call MAPL_GridGet(pgrid, localCellCountPerDim=COUNTS, &
globalCellCountPerDim=dims, RC=STATUS)
Expand Down Expand Up @@ -346,6 +359,8 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )

integer :: IM, JM
integer :: IM_WORLD, JM_WORLD
integer :: OIM, OJM
integer :: OIM_WORLD, OJM_WORLD
type(ESMF_Grid) :: ogrid, pgrid
type(ESMF_VM) :: vm
type(ESMF_Time) :: currentTime, dateN
Expand All @@ -360,6 +375,7 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
type (MAPL_MetaComp), pointer :: MAPL
logical :: amIRoot,dowrite
type(ESMF_Time) :: start_interval, end_interval
real :: gmax, gmin

!=============================================================================

Expand Down Expand Up @@ -405,6 +421,11 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )

UNIT_W = getfile(filename)

OIM = PrivateState%oim
OJM = PrivateState%ojm
OIM_WORLD = PrivateState%goim
OJM_WORLD = PrivateState%gojm

IM = PrivateState%pim
JM = PrivateState%pjm
IM_WORLD = PrivateState%gpim
Expand Down Expand Up @@ -484,13 +505,17 @@ subroutine RUN ( GC, IMPORT, EXPORT, CLOCK, RC )
! read(unit_r) odata
call MAPL_VarRead(unit_r, grid=ogrid, a=odata, rc=status)
VERIFY_(STATUS)
! transform data from ocean (tripolar or Reynolds) to mit-cubed
! Check global max/min
call MAPL_MaxMin('In data: ', odata)
! transform data from ocean (tripolar or Reynolds) to cubed
call privateState%regridder%regrid(odata,pdata,rc=status)
VERIFY_(status)
if (privateState%fix_fraction) then
where(pdata > 1.0) pdata = 1.0
where(pdata < 0.0) pdata = 0.0
end if
! Check global max/min
call MAPL_MaxMin('Out data: ', pdata)
! write(unit_w) pdata
if (doWrite) then
call MAPL_VarWrite(unit_w, grid=pgrid, a=pdata, rc=status)
Expand Down
13 changes: 10 additions & 3 deletions pre/remap_restart/remap_catchANDcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,32 @@ def remap(self):
NPE = 160

PARTITION =''
QOS = config['slurm_pbs']['qos']
QOS =''

qos = config['slurm_pbs']['qos']
TIME = "1:00:00"
if QOS != "debug": TIME="12:00:00"
if qos != "debug": TIME="3:00:00"

NNODE = ''
job = ''
if GEOS_SITE == 'NAS':
job = "PBS"
CONSTRAINT = 'cas_ait'
NNODE = (NPE-1)//40 + 1
if (qos != ''):
QOS = "#PBS -q "+qos
else:
job = "SLURM"
partition = config['slurm_pbs']['partition']
if (partition != ''):
PARTITION = "#SBATCH --partition=" + partition

CONSTRAINT = '"[cas|mil]"'
if (qos != ''):
QOS = "#SBATCH --qos="+qos

account = config['slurm_pbs']['account']

# even if the (MERRA-2) input restarts are binary, the output restarts will always be nc4 (remap_bin2nc.py)
suffix = '_rst.' + suffix
out_rstfile = expid + os.path.basename(in_rstfile).split('_rst')[0].split('.')[-1]+suffix
Expand Down Expand Up @@ -364,7 +371,7 @@ def has_catch_rst(text):
"type": "text",
"name": "slurm_pbs:qos",
"message": message_qos,
"default": "debug",
"default": "",
},

{
Expand Down
17 changes: 10 additions & 7 deletions pre/remap_restart/remap_command_line.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#
# remap_restarts package:
# remap_command_line.py parses and converts the command-line arguments and converts the information
# remap_command_line.py parses and converts the command-line arguments and converts the information
# into matching "Answers" for the questionary (remap_questions.py)
#
import os
Expand Down Expand Up @@ -64,10 +64,11 @@ def parse_args(program_description):
p_command.add_argument('-ocnmdlout', default='data', help='Ocean model for new restarts', choices=choices_omodel)
p_command.add_argument('-in_stretch', default=False, help='Stretched CS params of input restarts', choices=choices_stretch)
p_command.add_argument('-out_stretch', default=False, help='Stretched CS params for new restarts', choices=choices_stretch)

# Unlike remap_questions.py, command-line feature does not deduce Catch vs. CatchCN[40,45] for simplicity, thus requires input argument
p_command.add_argument('-catch_model',default='catch', help='Catchment[CN] model', choices=choices_catchmodel)

p_command.add_argument('-nonhydrostatic', action='store_true', help=" non hydrostatic upper air")
p_command.add_argument('-nobkg', action='store_true', help="Do not remap bkg files")
p_command.add_argument('-nolcv', action='store_true', help="Do not write lcv file")
p_command.add_argument('-np', action='store_true', help="No prompt. Overwrite config files without prompting questions")
Expand All @@ -77,10 +78,11 @@ def parse_args(program_description):
p_command.add_argument('-out_bc_base',default="", help="Boundary conditions base dir (w/o bc_version and resolution info) for new restarts")
p_command.add_argument('-zoom', help= "Zoom parameter (search radius) for input surface restarts")

p_command.add_argument('-qos', default="debug", help="slurm_pbs quality-of-service", choices=['debug', 'allnccs', 'normal'])
p_command.add_argument('-qos', default="", help="slurm_pbs quality-of-service", choices=['', 'debug', 'allnccs', 'normal'])
account = get_account()
p_command.add_argument('-account', default=account, help="slurm_pbs account")
p_command.add_argument('-partition', default='', help="slurm_pbs partition")
p_command.add_argument('-partition', default='', help="slurm_pbs partition")

p_command.add_argument('-rs', default='3', help="Flag indicating which restarts to regrid: 1 (upper air); 2 (surface); 3 (both)", choices=['1','2','3'])

# Parse using parse_known_args so we can pass the rest to the remap scripts
Expand Down Expand Up @@ -128,6 +130,7 @@ def get_answers_from_command_line(cml):
answers["output:shared:stretch"] = cml.out_stretch
answers["output:analysis:bkg"] = not cml.nobkg
answers["output:analysis:lcv"] = not cml.nolcv
answers["input:air:hydrostatic"] = not cml.nonhydrostatic
if cml.rs == '1':
answers["output:air:remap"] = True
answers["output:surface:remap_water"] = False
Expand All @@ -143,7 +146,7 @@ def get_answers_from_command_line(cml):

answers["output:air:agcm_import_rst"] = not cml.noagcm_import_rst

if cml.zoom:
if cml.zoom:
answers["input:surface:zoom"] = cml.zoom
else:
# zoom_default fills 'input:shared:agrid'
Expand All @@ -162,7 +165,7 @@ def get_answers_from_command_line(cml):
answers["slurm_pbs:account"] = cml.account
answers["slurm_pbs:qos"] = cml.qos
answers["slurm_pbs:partition"] = cml.partition

return answers

if __name__ == "__main__":
Expand All @@ -175,7 +178,7 @@ def get_answers_from_command_line(cml):
with open("raw_command.yaml", "w") as f:
yaml.dump(config, f)

config = get_config_from_answers(answers, config_tpl= True)
config = get_config_from_answers(answers, config_tpl= True)
with open("params_from_command.yaml", "w") as f:
yaml.dump(config, f)

21 changes: 17 additions & 4 deletions pre/remap_restart/remap_lake_landice_saltwater.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ def remap(self):
cmd = exe + out_til + ' ' + in_til + ' InData/'+ saltwater_internal + ' 0 ' + str(zoom)
self.run_and_log(cmd, log_name)

# split Saltwater
if config['output']['surface']['split_saltwater']:
print("\nSplitting Saltwater...\n")
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater
# split Saltwater Internal
# NOTE: split_saltwater==True means that the input restarts are already split.
# So we do not split them again.
if not config['output']['surface']['split_saltwater']:
print("\nSplitting Saltwater Internal...\n")
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater_internal
# subprocess.call(shlex.split(cmd))
openwater = ''
seaice = ''
Expand All @@ -152,6 +154,17 @@ def remap(self):
cmd = exe + out_til + ' ' + in_til + ' InData/'+ saltwater_import + ' 0 ' + str(zoom)
self.run_and_log(cmd, log_name)

# split Saltwater Import
# NOTE: split_saltwater==True means that the input restarts are already split.
# So we do not split them again.
if not config['output']['surface']['split_saltwater']:
print("\nSplitting Saltwater Import...\n")
cmd = bindir+'/SaltIntSplitter.x ' + out_til + ' ' + 'OutData/' + saltwater_import
# subprocess.call(shlex.split(cmd))
openwater = ''
seaice = ''
self.run_and_log(cmd, log_name)

if (openwater):
cmd = exe + out_til + ' ' + in_til + ' InData/' + openwater + ' 0 ' + str(zoom)
self.run_and_log(cmd, log_name)
Expand Down
4 changes: 2 additions & 2 deletions pre/remap_restart/remap_params.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
input:
air:
drymass: 1
hydrostatic: 0
hydrostatic: true
shared:
MERRA-2: false
GEOS-IT: false
Expand Down Expand Up @@ -64,5 +64,5 @@ output:
lcv: false
slurm_pbs:
account:
qos:
qos: ''
partition: ''
Loading