Skip to content

Commit

Permalink
Merge develop into main in prep for release v1.0.2 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmao-rreichle committed Apr 12, 2024
2 parents fc074ba + d0a542e commit 05bbcca
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 225 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ workflows:
repo: GEOSldas
checkout_fixture: true
mepodevelop: false
# This is needed due to the LDAS BRIDGE workflow
checkout_if_exists: false
persist_workspace: false # Needs to be true to run fv3/gcm experiment, costs extra
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
*#
.#*
**/CVS/

/@GEOSgcm_GridComp
/GEOSgcm_GridComp
/GEOSgcm_GridComp@
39 changes: 30 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

-----------------------------
### Added

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

### Fixed

- ldas_setup: Changed entry 'slurm' to 'slurm_pbs' to match remap_params.tpl
### Removed

### Deprecated

-----------------------------

## [v1.0.0] - 2024-03-26
## [v1.0.2] - 2024-04-12

- Inaugural version. 0-diff vs. GEOSldas v18.0.0.
- 0-diff vs. v1.0.1.

-----------------------------
### Fixed

### Added
- Bug fix for state increment array referencing in update_type=13 ([PR #26](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/26)).
- Fixed CI for LDAS workflow ([PR #34](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/34)).

### Changed

- Moved external `GEOSgcm_GridComp` repository to under `GEOSldas/src/Components` for
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)).
- Changed lenkf.j.template to python string ([PR #16](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/16)).


-----------------------------

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

- 0-diff vs. v1.0.0.

### Fixed

### Removed
- ldas_setup: Changed entry 'slurm' to 'slurm_pbs' to match remap_params.tpl ([PR #17](https://github.com/GEOS-ESM/GEOSldas_GridComp/pull/17)).

-----------------------------

## [v1.0.0] - 2024-03-26

- Inaugural version. 0-diff vs. GEOSldas v18.0.0.

-----------------------------

### Deprecated

2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
esma_set_this ()

esma_add_subdirectory(GEOSgcm_GridComp)

set (alldirs
GEOSmetforce_GridComp
GEOSlandpert_GridComp
Expand Down
32 changes: 16 additions & 16 deletions GEOSlandassim_GridComp/clsm_ensupd_upd_routines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4805,21 +4805,21 @@ subroutine cat_enkf_increments( &
State_incr(1,:) = cat_progn( kk,:)%srfexc/scale_srfexc
State_incr(2,:) = cat_progn( kk,:)%rzexc /scale_rzexc

State_incr(4,:) = cat_progn( kk,:)%tc1 /scale_temp
State_incr(5,:) = cat_progn( kk,:)%tc2 /scale_temp
State_incr(6,:) = cat_progn( kk,:)%tc4 /scale_temp
State_incr(7,:) = cat_progn( kk,:)%ght(1)/scale_ght1
State_incr(3,:) = cat_progn( kk,:)%tc1 /scale_temp
State_incr(4,:) = cat_progn( kk,:)%tc2 /scale_temp
State_incr(5,:) = cat_progn( kk,:)%tc4 /scale_temp
State_incr(6,:) = cat_progn( kk,:)%ght(1)/scale_ght1

else

State_incr(1,:) = cat_progn( kk,:)%srfexc/scale_srfexc
State_incr(2,:) = cat_progn( kk,:)%rzexc /scale_rzexc
State_incr(3,:) = cat_progn( kk,:)%catdef/scale_catdef ! catdef in State

State_incr(3,:) = cat_progn( kk,:)%tc1 /scale_temp
State_incr(4,:) = cat_progn( kk,:)%tc2 /scale_temp
State_incr(5,:) = cat_progn( kk,:)%tc4 /scale_temp
State_incr(6,:) = cat_progn( kk,:)%ght(1)/scale_ght1
State_incr(4,:) = cat_progn( kk,:)%tc1 /scale_temp
State_incr(5,:) = cat_progn( kk,:)%tc2 /scale_temp
State_incr(6,:) = cat_progn( kk,:)%tc4 /scale_temp
State_incr(7,:) = cat_progn( kk,:)%ght(1)/scale_ght1

end if

Expand Down Expand Up @@ -4863,21 +4863,21 @@ subroutine cat_enkf_increments( &
cat_progn_incr(kk,:)%srfexc = State_incr(1,:)*scale_srfexc
cat_progn_incr(kk,:)%rzexc = State_incr(2,:)*scale_rzexc

cat_progn_incr(kk,:)%tc1 = State_incr(4,:)*scale_temp
cat_progn_incr(kk,:)%tc2 = State_incr(5,:)*scale_temp
cat_progn_incr(kk,:)%tc4 = State_incr(6,:)*scale_temp
cat_progn_incr(kk,:)%ght(1) = State_incr(7,:)*scale_ght1
cat_progn_incr(kk,:)%tc1 = State_incr(3,:)*scale_temp
cat_progn_incr(kk,:)%tc2 = State_incr(4,:)*scale_temp
cat_progn_incr(kk,:)%tc4 = State_incr(5,:)*scale_temp
cat_progn_incr(kk,:)%ght(1) = State_incr(6,:)*scale_ght1

else

cat_progn_incr(kk,:)%srfexc = State_incr(1,:)*scale_srfexc
cat_progn_incr(kk,:)%rzexc = State_incr(2,:)*scale_rzexc
cat_progn_incr(kk,:)%catdef = State_incr(3,:)*scale_catdef ! catdef in State

cat_progn_incr(kk,:)%tc1 = State_incr(3,:)*scale_temp
cat_progn_incr(kk,:)%tc2 = State_incr(4,:)*scale_temp
cat_progn_incr(kk,:)%tc4 = State_incr(5,:)*scale_temp
cat_progn_incr(kk,:)%ght(1) = State_incr(6,:)*scale_ght1
cat_progn_incr(kk,:)%tc1 = State_incr(4,:)*scale_temp
cat_progn_incr(kk,:)%tc2 = State_incr(5,:)*scale_temp
cat_progn_incr(kk,:)%tc4 = State_incr(6,:)*scale_temp
cat_progn_incr(kk,:)%ght(1) = State_incr(7,:)*scale_ght1

end if

Expand Down
3 changes: 2 additions & 1 deletion GEOSldas_App/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ set (scripts
ens_forcing/regrid_forc.csh
ens_forcing/enpert_forc.csh
util/config/rewind_GEOSldas.csh
lenkf_j_template.py
)

install (
Expand All @@ -42,7 +43,7 @@ file(GLOB rc_files GEOSldas_*rc)
file(GLOB nml_files LDASsa_DEFAULT*nml)

install(
FILES ${rc_files} ${nml_files} lenkf.j.template
FILES ${rc_files} ${nml_files}
DESTINATION etc
)

Expand Down
109 changes: 41 additions & 68 deletions GEOSldas_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from dateutil.relativedelta import relativedelta
from remap_utils import *
from remap_catchANDcn import *
from remap_config_ldas import *

from lenkf_j_template import *
"""
This script is intended to be run from any installed directory with GEOSldas.x and ldas_setup
(The default setup is ../install/bin)
Expand Down Expand Up @@ -166,9 +166,10 @@ class LDASsetup:
assert not os.path.isdir(_mydir), 'Dir [%s] already exists!' % _mydir
_mydir = None
self.ladas_coupling = int(self.rqdExeInp.get('LADAS_COUPLING',0))
self.adas_expdir =''
if self.ladas_coupling > 0:
assert 'ADAS_EXPDIR' in self.rqdExeInp, " need ADAS_EXPDIR in the input file %s" %(self.exeinpfile)

self.adas_expdir = self.rqdExeInp['ADAS_EXPDIR']
self.first_ens_id = int(self.rqdExeInp.get('FIRST_ENS_ID',0))
self.perturb = int(self.rqdExeInp.get('PERTURBATIONS',0))
if self.nens > 1:
Expand Down Expand Up @@ -1294,8 +1295,6 @@ class LDASsetup:
status = False

os.chdir(self.rundir)
lenkf=self.blddir+'/etc/lenkf.j.template'
shutil.copy(lenkf,'lenkf.j')

my_qos='allnccs'
if self.GEOS_SITE == 'NAS': my_qos = 'normal'
Expand Down Expand Up @@ -1330,71 +1329,45 @@ class LDASsetup:
'.'.join([expid, 'ldas_err', myDateTime, 'txt']),
]),
self.rundir)
with open(lenkf,'rt') as fin:
with open('lenkf.j','wt') as fout :
for line in fin :
if self.GEOS_SITE == 'NAS':
if '#SBATCH' in line:
continue
if 'sbatch $HOMDIR/lenkf.j' in line:
continue

if self.GEOS_SITE == 'NCCS':
if '#PBS' in line:
continue
if 'qsub $HOMDIR/lenkf.j' in line:
continue

if 'MY_ACCOUNT' in line :
fout.write(line.replace('MY_ACCOUNT',self.rqdRmInp['account']))
elif 'MY_WALLTIME' in line :
fout.write(line.replace('MY_WALLTIME',self.rqdRmInp['walltime']))
elif 'MY_NODES' in line :
line_ = line.replace('MY_NODES',str(self.optRmInp['nodes']))
line_ = line_.replace('MY_NTASKS_PER_NODE',str(self.rqdRmInp['ntasks-per-node']))
line_ = line_.replace('MY_CONSTRAINT', 'cas_ait')
fout.write(line_)
if self.GEOS_SITE == "NCCS" :
if self.BUILT_ON_SLES15 :
fout.write("#SBATCH --constraint=mil\n")
else:
assert int(self.rqdRmInp['ntasks-per-node']) <= 46, 'ntasks-per-node should be <=46 for cas'
fout.write("#SBATCH --constraint=cas\n")

elif 'MY_OSERVER_NODES' in line :
fout.write(line.replace('MY_OSERVER_NODES',str(self.optRmInp['oserver_nodes'])))
elif 'MY_WRITERS_NPES' in line :
fout.write(line.replace('MY_WRITERS_NPES', str(self.optRmInp['writers-per-node'])))
elif 'MY_QOS' in line :
if 'allnccs' not in my_qos or 'normal' not in my_qos:
fout.write(line.replace('MY_QOS',my_qos))
elif 'MY_JOB' in line :
fout.write(line.replace('MY_JOB',my_job))
elif 'MY_EXPID' in line :
fout.write(line.replace('MY_EXPID',self.rqdExeInp['EXP_ID']))
elif 'MY_EXPDOMAIN' in line :
fout.write(line.replace('MY_EXPDOMAIN',self.rqdExeInp['EXP_DOMAIN']))
elif 'MY_LOGFILE' in line :
fout.write(line.replace('MY_LOGFILE',my_logfile))
elif 'MY_ERRFILE' in line :
fout.write(line.replace('MY_ERRFILE',my_errfile))
elif 'MY_MODEL' in line :
fout.write(line.replace('MY_MODEL',self.catch))
elif 'MY_POSTPROC_HIST' in line :
fout.write(line.replace('MY_POSTPROC_HIST',str(self.rqdExeInp['POSTPROC_HIST'])))
elif 'MY_FIRST_ENS_ID' in line :
fout.write(line.replace('MY_FIRST_ENS_ID',str(self.first_ens_id)))
elif 'MY_LADAS_COUPLING' in line :
fout.write(line.replace('MY_LADAS_COUPLING',str(self.ladas_coupling)))
elif 'MY_ENSEMBLE_FORCING' in line :
fout.write(line.replace('MY_ENSEMBLE_FORCING',self.rqdExeInp.get('ENSEMBLE_FORCING', 'NO').upper()))
elif 'MY_ADAS_EXPDIR' in line :
if self.ladas_coupling > 0:
fout.write(line.replace('MY_ADAS_EXPDIR', self.rqdExeInp['ADAS_EXPDIR']))
else :
my_expdir = self.exphome + '/' + self.rqdExeInp['EXP_ID']
fout.write(line.replace('MY_EXPDIR',my_expdir))
constraint='cas'
if self.GEOS_SITE == "NAS":
constraint = 'cas_ait'
elif self.BUILT_ON_SLES15:
constraint = 'mil'
else:
assert int(self.rqdRmInp['ntasks-per-node']) <= 46, 'ntasks-per-node should be <=46 for cas'

SBATCHQSUB = 'sbatch'
if self.GEOS_SITE == 'NAS':
SBATCHQSUB = 'qsub'

job_head = job_directive[self.GEOS_SITE]
lenkf_str= (job_head+job_body).format(
SBATCHQSUB = SBATCHQSUB,
MY_ACCOUNT = self.rqdRmInp['account'],
MY_WALLTIME = self.rqdRmInp['walltime'],
MY_NODES = str(self.optRmInp['nodes']),
MY_NTASKS_PER_NODE = str(self.rqdRmInp['ntasks-per-node']),
MY_CONSTRAINT = constraint,
MY_OSERVER_NODES = str(self.optRmInp['oserver_nodes']),
MY_WRITERS_NPES = str(self.optRmInp['writers-per-node']),
MY_QOS = my_qos,
MY_JOB = my_job,
MY_EXPID = self.rqdExeInp['EXP_ID'],
MY_EXPDOMAIN = self.rqdExeInp['EXP_DOMAIN'],
MY_LOGFILE = my_logfile,
MY_ERRFILE = my_errfile,
MY_MODEL = self.catch,
MY_POSTPROC_HIST = str(self.rqdExeInp['POSTPROC_HIST']),
MY_FIRST_ENS_ID = str(self.first_ens_id),
MY_LADAS_COUPLING = str(self.ladas_coupling),
MY_ENSEMBLE_FORCING= self.rqdExeInp.get('ENSEMBLE_FORCING', 'NO').upper(),
MY_ADAS_EXPDIR = self.adas_expdir,
MY_EXPDIR = self.exphome + '/' + self.rqdExeInp['EXP_ID']
)

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

expdir = '/'.join(self.rundir.rstrip('/').split('/')[:-1])
Expand Down
Loading

0 comments on commit 05bbcca

Please sign in to comment.