Skip to content

Commit 87a7e6c

Browse files
Merge main into develop in prep for future release (#59)
Not 0-diff for data assimilation in cube-sphere tile space (#41)
2 parents 05bbcca + 2bbd3a0 commit 87a7e6c

File tree

9 files changed

+405
-442
lines changed

9 files changed

+405
-442
lines changed

CHANGELOG.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16+
- More optimal distribution of tiles on processors for cubed-sphere tile space.
17+
- Updates to scripting to allow for Intel MPI
18+
1619
### Fixed
1720

21+
- Do not increment CO2_YEAR when it is a no-data-value. For Catchment simulations, exclude CatchCN-specific resource variables from LDAS.rc.
22+
- Bug fix and improved efficiency in matlab script for generation of mwRTM_param.
23+
- Changed EXPDIR to absolute path for POSTPROC_HIST>0 option to work.
24+
- Support HISTORY output of ASNOW alone from ENSAVG Gridcomp.
25+
1826
### Removed
1927

28+
- Remove restart options F and G.
29+
2030
### Deprecated
2131

2232
-----------------------------
@@ -34,9 +44,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3444

3545
- Moved external `GEOSgcm_GridComp` repository to under `GEOSldas/src/Components` for
3646
consistency with directory structure of GEOSgcm and GEOSadas ([PR #27](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/27), [PR #30](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/30)).
37-
- Changed lenkf.j.template to python string ([PR #16](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/16)).
47+
- Changed lenkf.j.template to python string ([PR #16](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/16)).
48+
3849

39-
4050
-----------------------------
4151

4252
## [v1.0.1] - 2024-04-10

GEOSens_GridComp/GEOS_EnsGridComp.F90

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,8 +2339,7 @@ subroutine Collect_land_ens(gc, import, export, clock, rc)
23392339
real, dimension(:),pointer :: TPUNST,TPUNST_enavg
23402340
real, dimension(:),pointer :: TPSAT,TPSAT_enavg
23412341
real, dimension(:),pointer :: TPWLT,TPWLT_enavg
2342-
!real, dimension(:),pointer :: ASNOW,ASNOW_enavg
2343-
real, dimension(:),pointer :: ASNOW_enavg
2342+
real, dimension(:),pointer :: ASNOW,ASNOW_enavg
23442343
real, dimension(:),pointer :: SHSNOW,SHSNOW_enavg
23452344
real, dimension(:),pointer :: AVETSNOW,AVETSNOW_enavg
23462345
real, dimension(:),pointer :: FRSAT,FRSAT_enavg
@@ -2633,9 +2632,8 @@ subroutine Collect_land_ens(gc, import, export, clock, rc)
26332632
VERIFY_(status)
26342633
call MAPL_GetPointer(import, FRWLT, 'FRWLT' ,rc=status)
26352634
VERIFY_(status)
2636-
! for offline model , there is no 'ASNOW', recompute
2637-
! call MAPL_GetPointer(import, ASNOW, 'ASNOW' ,rc=status)
2638-
! VERIFY_(status)
2635+
call MAPL_GetPointer(import, ASNOW, 'ASNOW' ,rc=status)
2636+
VERIFY_(status)
26392637
call MAPL_GetPointer(import, SNOWMASS, 'SNOWMASS' ,rc=status)
26402638
VERIFY_(status)
26412639
call MAPL_GetPointer(import, SNOWDP, 'SNOWDP' ,rc=status)
@@ -3380,8 +3378,8 @@ subroutine Collect_land_ens(gc, import, export, clock, rc)
33803378
TPSAT_enavg = TPSAT_enavg + TPSAT
33813379
if(associated(TPWLT_enavg) .and. associated(TPWLT)) &
33823380
TPWLT_enavg = TPWLT_enavg + TPWLT
3383-
!if(associated(ASNOW_enavg) .and. associated(ASNOW)) &
3384-
! ASNOW_enavg = ASNOW_enavg + ASNOW
3381+
if(associated(ASNOW_enavg) .and. associated(ASNOW)) &
3382+
ASNOW_enavg = ASNOW_enavg + ASNOW
33853383
if(associated(SHSNOW_enavg) .and. associated(SHSNOW)) &
33863384
SHSNOW_enavg = SHSNOW_enavg + SHSNOW
33873385
if(associated(AVETSNOW_enavg) .and. associated(AVETSNOW)) &
@@ -3680,10 +3678,18 @@ subroutine Collect_land_ens(gc, import, export, clock, rc)
36803678
if(associated(TPWLT_enavg)) TPWLT_enavg = TPWLT_enavg/NUM_ENSEMBLE
36813679
if(associated(SHSNOW_enavg)) SHSNOW_enavg = SHSNOW_enavg/NUM_ENSEMBLE
36823680
if(associated(AVETSNOW_enavg)) AVETSNOW_enavg = AVETSNOW_enavg/NUM_ENSEMBLE
3683-
if(associated(FRSAT_enavg)) FRSAT_enavg = FRSAT_enavg/NUM_ENSEMBLE
3684-
if(associated(FRUST_enavg)) FRUST_enavg = FRUST_enavg/NUM_ENSEMBLE
3685-
if(associated(FRWLT_enavg)) FRWLT_enavg = FRWLT_enavg/NUM_ENSEMBLE
3686-
if(associated(ASNOW_enavg)) ASNOW_enavg = max(min(1.0-(FRSAT_enavg+FRUST_enavg+FRWLT_enavg),1.0),0.0)
3681+
if(associated(FRSAT_enavg)) FRSAT_enavg = max(min(FRSAT_enavg/NUM_ENSEMBLE,1.0),0.0)
3682+
if(associated(FRUST_enavg)) FRUST_enavg = max(min(FRUST_enavg/NUM_ENSEMBLE,1.0),0.0)
3683+
if(associated(FRWLT_enavg)) FRWLT_enavg = max(min(FRWLT_enavg/NUM_ENSEMBLE,1.0),0.0)
3684+
if(associated(ASNOW_enavg)) then
3685+
ASNOW_enavg = max(min(1.0,ASNOW_enavg/NUM_ENSEMBLE),0.0)
3686+
! If all four area fractions are calculated, try to make them sum up to 1.
3687+
! Because the [0,1] range is also enforced, the following simple approach does not always
3688+
! work perfectly, but it should be good enough. A more robust approach would require
3689+
! many more if statements. -reichle, 5 Jun 2024
3690+
if(associated(FRSAT_enavg) .and. associated(FRUST_enavg) .and. associated(FRWLT_enavg)) &
3691+
ASNOW_enavg = max(min(1.0-(FRSAT_enavg+FRUST_enavg+FRWLT_enavg),1.0),0.0)
3692+
end if
36873693
if(associated(SNOWMASS_enavg)) SNOWMASS_enavg = SNOWMASS_enavg/NUM_ENSEMBLE
36883694
if(associated(SNOWDP_enavg)) SNOWDP_enavg = SNOWDP_enavg/NUM_ENSEMBLE
36893695
if(associated(WET1_enavg)) WET1_enavg = WET1_enavg/NUM_ENSEMBLE

GEOSldas_App/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ ecbuild_add_executable (
2121

2222
set (scripts
2323
process_hist.csh
24-
remap_config_ldas.py
2524
ens_forcing/average_ensemble_forcing.py
2625
ens_forcing/ensemble_forc.py
2726
ens_forcing/regrid_forc.csh

GEOSldas_App/ldas_setup

Lines changed: 48 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ from collections import OrderedDict
2020
from dateutil.relativedelta import relativedelta
2121
from remap_utils import *
2222
from remap_catchANDcn import *
23-
from remap_config_ldas import *
2423
from lenkf_j_template import *
2524
"""
2625
This script is intended to be run from any installed directory with GEOSldas.x and ldas_setup
@@ -92,8 +91,9 @@ class LDASsetup:
9291
# Instance variables
9392
self.exeinpfile = cmdLineArgs['exeinpfile']
9493
self.batinpfile = cmdLineArgs['batinpfile']
95-
self.exphome = cmdLineArgs['exphome'].rstrip('/')
96-
assert os.path.isdir(self.exphome) # exphome should exist
94+
exphome_ = cmdLineArgs['exphome'].rstrip('/')
95+
assert os.path.isdir(exphome_) # exphome should exist
96+
self.exphome = os.path.abspath(exphome_)
9797
self.verbose = cmdLineArgs['verbose']
9898
self.runmodel = cmdLineArgs['runmodel']
9999
if self.runmodel :
@@ -508,21 +508,17 @@ class LDASsetup:
508508
tmp_execfyl= self.blddir+exefyl
509509
assert os.path.isfile(tmp_execfyl),\
510510
'Executable [%s] does not exist!' % tmp_execfyl
511-
tmp_expid = self.rqdExeInp['EXP_ID']
512-
tmp_expdir = os.path.abspath(self.exphome + '/' + self.rqdExeInp['EXP_ID'])
513-
self.rundir = tmp_expdir + '/run'
514-
self.inpdir = tmp_expdir + '/input'
515-
self.outdir = tmp_expdir + '/output'
516-
self.scratchdir = tmp_expdir + '/scratch'
517-
self.blddirLn = tmp_expdir + '/build'
511+
self.expdir = self.exphome + '/' + self.rqdExeInp['EXP_ID']
512+
self.rundir = self.expdir + '/run'
513+
self.inpdir = self.expdir + '/input'
514+
self.outdir = self.expdir + '/output'
515+
self.scratchdir = self.expdir + '/scratch'
516+
self.blddirLn = self.expdir + '/build'
518517
self.out_path = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']
519518
self.bcsdir = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']+'/rc_out/'
520519
self.rstdir = self.outdir+'/'+self.rqdExeInp['EXP_DOMAIN']+'/rs/'
521520
self.exefyl = self.blddirLn+exefyl
522521

523-
tmp_expid = None
524-
tmp_expdir = None
525-
526522
my_ntasks_per_node = int(self.rqdRmInp['ntasks-per-node'])
527523

528524
# default number of nodes
@@ -741,7 +737,7 @@ class LDASsetup:
741737
wemin_out = self.rqdExeInp['WEMIN_OUT']
742738

743739

744-
tmp_f2g_file = tempfile.NamedTemporaryFile(delete=False)
740+
tmp_f2g_file = tempfile.NamedTemporaryFile(delete=False)
745741
cmd = self.bindir +'/preprocess_ldas.x c_f2g ' + tile + ' ' + self.domain_def.name + ' '+ self.out_path + ' ' + catchment_def + ' ' + exp_id + ' ' + _y4m2d2h2m2 + ' '+ dzsf + ' ' + tmp_f2g_file.name
746742

747743
print ('Creating f2g file: '+ tmp_f2g_file.name +'....\n')
@@ -881,7 +877,30 @@ class LDASsetup:
881877
config['output']['surface']['surflay'] = dzsf
882878
config['output']['surface']['wemin'] = wemin_out
883879

884-
config = remap_config_ldas( config, RESTART_str, self.rqdExeInp['RESTART_PATH'], self.rqdExeInp['RESTART_ID'])
880+
if RESTART_str == "M" : # restart from merra2
881+
yyyymm = int(YYYYMMDDHH[0:6])
882+
merra2_expid = "d5124_m2_jan10"
883+
if yyyymm < 197901 :
884+
exit("Error. MERRA-2 data < 1979 not available\n")
885+
elif (yyyymm < 199201):
886+
merra2_expid = "d5124_m2_jan79"
887+
elif (yyyymm < 200106):
888+
merra2_expid = "d5124_m2_jan91"
889+
elif (yyyymm < 201101):
890+
merra2_expid = "d5124_m2_jan00"
891+
elif (yyyymm < 202106):
892+
merra2_expid = "d5124_m2_jan10"
893+
# There was a rewind in MERRA2 from Jun 2021 to Sept 2021
894+
elif (yyyymm < 202110):
895+
merra2_expid = "d5124_m2_jun21"
896+
config['input']['shared']['expid'] = merra2_expid
897+
config['input']['shared']['rst_dir'] = mk_outdir+ '/merra2_tmp_'+ YYYYMMDDHH
898+
config['input']['surface']['wemin'] = 26
899+
config['input']['shared']['bc_base'] = '/discover/nobackup/projects/gmao/bcs_shared/fvInput/ExtData/esm/tiles'
900+
config['input']['shared']['bc_version'] = 'GM4'
901+
config['input']['shared']['agrid'] = 'C180'
902+
config['input']['shared']['ogrid'] = '1440x720'
903+
config['input']['shared']['omodel'] = 'data'
885904

886905
catch_obj = catchANDcn(config_obj = config)
887906
catch_obj.remap()
@@ -1147,6 +1166,13 @@ class LDASsetup:
11471166
ldasrcInp[keyn]= valn
11481167
if('catchcn' in self.catch):
11491168
ldasrcInp['CO2_MonthlyMean_DiurnalCycle_FILE']= '../input/CO2_MonthlyMean_DiurnalCycle.nc4'
1169+
else:
1170+
# remove catchcn-specific entries that do not apply to catch model
1171+
ldasrcInp.pop('DTCN',None)
1172+
ldasrcInp.pop('ATM_CO2',None)
1173+
ldasrcInp.pop('CO2',None)
1174+
ldasrcInp.pop('CO2_YEAR',None)
1175+
ldasrcInp.pop('PRESCRIBE_DVG',None)
11501176

11511177
# create restart item in RC
11521178
catch_ = self.catch.upper()
@@ -1341,6 +1367,8 @@ class LDASsetup:
13411367
if self.GEOS_SITE == 'NAS':
13421368
SBATCHQSUB = 'qsub'
13431369

1370+
DETECTED_MPI_STACK = "@MPI_STACK@"
1371+
13441372
job_head = job_directive[self.GEOS_SITE]
13451373
lenkf_str= (job_head+job_body).format(
13461374
SBATCHQSUB = SBATCHQSUB,
@@ -1363,15 +1391,16 @@ class LDASsetup:
13631391
MY_LADAS_COUPLING = str(self.ladas_coupling),
13641392
MY_ENSEMBLE_FORCING= self.rqdExeInp.get('ENSEMBLE_FORCING', 'NO').upper(),
13651393
MY_ADAS_EXPDIR = self.adas_expdir,
1366-
MY_EXPDIR = self.exphome + '/' + self.rqdExeInp['EXP_ID']
1394+
MY_EXPDIR = self.expdir,
1395+
DETECTED_MPI_STACK = DETECTED_MPI_STACK,
1396+
BUILT_ON_SLES15 = str(self.BUILT_ON_SLES15).upper()
13671397
)
13681398

13691399
with open('lenkf.j','wt') as fout :
13701400
fout.write(lenkf_str)
13711401
sp.call(['chmod', '755', 'lenkf.j'])
13721402

1373-
expdir = '/'.join(self.rundir.rstrip('/').split('/')[:-1])
1374-
print ('\nExperiment directory: %s' % expdir)
1403+
print ('\nExperiment directory: %s' % self.expdir)
13751404
print ()
13761405
status = True
13771406
return status
@@ -1444,12 +1473,6 @@ def _printExeInputKeys(rqdExeInpKeys):
14441473
print ('# RESTART: M #')
14451474
print ('# Re-tile from archived MERRA-2 restart file. #')
14461475
print ('# #')
1447-
print ('# RESTART: F #')
1448-
print ('# Re-tile from FP (Forward Processing) restart file. #')
1449-
print ('# #')
1450-
print ('# RESTART: G #')
1451-
print ('# Re-tile from any AGCM catch[cnclmxx]_internal_rst file.#')
1452-
print ('# #')
14531476
print ('# -------------------------------------------------------- #')
14541477
print ('# IMPORTANT: #')
14551478
print ('# Except for RESTART=1, SPIN-UP is REQUIRED in almost #')
@@ -1464,15 +1487,10 @@ def _printExeInputKeys(rqdExeInpKeys):
14641487
print ('# restarts stored as follows: #')
14651488
print ('# RESTART_PATH/RESTART_ID/output/RESTART_DOMAIN/rs/ #')
14661489
print ('# #')
1467-
print ('# For RESTART=0 or RESTART=M or RESTART=F: #')
1490+
print ('# For RESTART=0 or RESTART=M: #')
14681491
print ('# There is no need to specify RESTART_ID, RESTART_PATH, #')
14691492
print ('# and RESTART_DOMAIN. #')
14701493
print ('# #')
1471-
print ('# For RESTART=G: #')
1472-
print ('# RESTART_ID : full_path_to_AGCM_experiment_directory #')
1473-
print ('# RESTART_PATH : full_path_of_the_AGCM_restart_file #')
1474-
print ('# RESTART_DOMAIN is NOT required. #')
1475-
print ('# #')
14761494
print ('############################################################')
14771495
print ()
14781496
print ('RESTART:')

0 commit comments

Comments
 (0)