Skip to content

Commit

Permalink
add 2 to ens_id_width for "_e"
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyuan-jiang committed Oct 6, 2022
1 parent e5d4b65 commit a045efd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Applications/LDAS_App/ldas_setup
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class LDASsetup:
self.ladas_coupling = 0
self.in_rstfile = None
self.in_tilefile = 'None' # default string
self.ens_id_width = 4 # _exxxx
self.ens_id_width = 6 # _exxxx
# ------
# Read exe input file which is required to set up the dir
# ------
Expand Down Expand Up @@ -161,7 +161,7 @@ class LDASsetup:
self.perturb = 1
self.ensdirs = ['ens%04d'%iens for iens in range(self.first_ens_id, self.nens + self.first_ens_id)]
# if self.ens_id_width = 4, _width = '_e%04d'
_width = '_e%0{}d'.format(self.ens_id_width)
_width = '_e%0{}d'.format(self.ens_id_width-2)
# self.ensids will be a list of [_e0000, _e0001, ...]
self.ensids = [ _width%iens for iens in range(self.first_ens_id, self.nens + self.first_ens_id)]
if (self.nens == 1) :
Expand Down
4 changes: 2 additions & 2 deletions src/Components/GEOSldas_GridComp/GEOS_LdasGridComp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ subroutine SetServices(gc, rc)
allocate(LAND(NUM_ENSEMBLE),LANDPERT(NUM_ENSEMBLE))

if (NUM_ENSEMBLE > 1) then
_ASSERT( ens_id_width < 10, "need 1 billion ensemble members? increase ens_id_width first")
_ASSERT( ens_id_width >= 3, "need at least 3 for hard coded ensemble forcing")
_ASSERT( ens_id_width < 12, "need 1 billion ensemble members? increase ens_id_width first")
_ASSERT( ens_id_width >= 5, "need at least 5 (_exxx) for hard coded ensemble forcing ( 3, xxx)")
endif

do i=1,NUM_ENSEMBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ subroutine get_ensid_string(ensid_string, id, ens_id_width, num_ensemble)
return
endif

if (ens_id_width <=0) then
if (ens_id_width < 5) then
call ldas_abort(LDAS_GENERIC_ERROR, 'get_ensid_string', 'ens_id_width should be greater than 1')
endif

write (fmt_str, "(A2,I1,A1,I1,A1)") "(I", ens_id_width,".",ens_id_width,")"
write (fmt_str, "(A2,I1,A1,I1,A1)") "(I", ens_id_width-2,".",ens_id_width-2,")"
write (ensid_string, fmt_str) id
ensid_string = '_e'//trim(ensid_string)

Expand Down

0 comments on commit a045efd

Please sign in to comment.