Skip to content

Commit

Permalink
Merge pull request #1643 from jvgeiger/fix/ModelOutput_2d_ens_grid_cp
Browse files Browse the repository at this point in the history
Fix the bug in writing model output in 2D ensemble grid space #1627
  • Loading branch information
jvgeiger authored Nov 26, 2024
2 parents cf937a1 + 0279dba commit 06716e5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lis/core/LIS_historyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ module LIS_historyMod
! used in GRIB1 & GRIB2 format
! 18 Oct 2018: David Mocko: Check lis.config entry for option to turn off
! writing ASCII stats files with netCDF output format
! 25 Oct 2024: Mahdi Navari: updated the code to fix the bug in writing
! model output in 2D ensemble grid space (see https://github.com/NASA-LIS/LISF/issues/1627 )
!
! !USES:
use LIS_coreMod
Expand Down Expand Up @@ -3440,16 +3442,16 @@ subroutine defineNETCDFheaderVar(n,ftn,dimID, dataEntry, non_model_fields)
! lat/lon field output will write in 1D
if(LIS_rc%nlatlon_dimensions == '1D') then
if(nmodel_status.eq.1) then
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
nf90_float,&
dimids = dimID(2), varID=dataEntry%varId_def),&
'nf90_def_var for '//trim(short_name)//&
'nf90_def_var for '//trim(dataEntry%short_name)//&
'failed in defineNETCDFheadervar')
elseif(nmodel_status.eq.2) then
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
nf90_float,&
dimids = dimID(1), varID=dataEntry%varId_def),&
'nf90_def_var for '//trim(short_name)//&
'nf90_def_var for '//trim(dataEntry%short_name)//&
'failed in defineNETCDFheadervar')
else
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name)//'_tavg',&
Expand All @@ -3460,10 +3462,10 @@ subroutine defineNETCDFheaderVar(n,ftn,dimID, dataEntry, non_model_fields)
endif
! latlon field output will write in 2D
else
call LIS_verify(nf90_def_var(ftn,trim(short_name),&
call LIS_verify(nf90_def_var(ftn,trim(dataEntry%short_name),&
nf90_float,&
dimids = dimID(1:2), varID=dataEntry%varID_def),&
'nf90_def_var for '//trim(short_name)//&
'nf90_def_var for '//trim(dataEntry%short_name)//&
'failed in defineNETCDFheadervar')
endif

Expand Down

0 comments on commit 06716e5

Please sign in to comment.