Skip to content

Commit 06716e5

Browse files
authored
Merge pull request #1643 from jvgeiger/fix/ModelOutput_2d_ens_grid_cp
Fix the bug in writing model output in 2D ensemble grid space #1627
2 parents cf937a1 + 0279dba commit 06716e5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lis/core/LIS_historyMod.F90

+8-6
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ module LIS_historyMod
6666
! used in GRIB1 & GRIB2 format
6767
! 18 Oct 2018: David Mocko: Check lis.config entry for option to turn off
6868
! writing ASCII stats files with netCDF output format
69+
! 25 Oct 2024: Mahdi Navari: updated the code to fix the bug in writing
70+
! model output in 2D ensemble grid space (see https://github.com/NASA-LIS/LISF/issues/1627 )
6971
!
7072
! !USES:
7173
use LIS_coreMod
@@ -3440,16 +3442,16 @@ subroutine defineNETCDFheaderVar(n,ftn,dimID, dataEntry, non_model_fields)
34403442
! lat/lon field output will write in 1D
34413443
if(LIS_rc%nlatlon_dimensions == '1D') then
34423444
if(nmodel_status.eq.1) then
3443-
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
3445+
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
34443446
nf90_float,&
34453447
dimids = dimID(2), varID=dataEntry%varId_def),&
3446-
'nf90_def_var for '//trim(short_name)//&
3448+
'nf90_def_var for '//trim(dataEntry%short_name)//&
34473449
'failed in defineNETCDFheadervar')
34483450
elseif(nmodel_status.eq.2) then
3449-
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
3451+
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
34503452
nf90_float,&
34513453
dimids = dimID(1), varID=dataEntry%varId_def),&
3452-
'nf90_def_var for '//trim(short_name)//&
3454+
'nf90_def_var for '//trim(dataEntry%short_name)//&
34533455
'failed in defineNETCDFheadervar')
34543456
else
34553457
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name)//'_tavg',&
@@ -3460,10 +3462,10 @@ subroutine defineNETCDFheaderVar(n,ftn,dimID, dataEntry, non_model_fields)
34603462
endif
34613463
! latlon field output will write in 2D
34623464
else
3463-
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
3465+
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
34643466
nf90_float,&
34653467
dimids = dimID(1:2), varID=dataEntry%varID_def),&
3466-
'nf90_def_var for '//trim(short_name)//&
3468+
'nf90_def_var for '//trim(dataEntry%short_name)//&
34673469
'failed in defineNETCDFheadervar')
34683470
endif
34693471

0 commit comments

Comments
 (0)