From 33395fe1424e6194f0a2b6a03993c31fdfda8239 Mon Sep 17 00:00:00 2001 From: Dan Rosen Date: Mon, 25 Nov 2024 18:17:16 -0500 Subject: [PATCH 1/3] Cleanup NUOPC Cap - remove comments --- .../nuopc_cpl_mode/LIS_ESMF_Extensions.F90 | 526 +++++++++--------- lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 | 300 +++++----- .../nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 | 256 ++++----- .../nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 | 118 ++-- 4 files changed, 600 insertions(+), 600 deletions(-) diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 index 1fe8d4f56..e834e30df 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 @@ -258,7 +258,7 @@ subroutine LIS_ESMF_GridWrite_coords(grid, nclScript, mapName, minCoords, & call LIS_ESMF_GridWrite(grid, fileName=fileName, overwrite=overwrite, & status=status, timeslice=timeslice, iofmt=iofmt, & relaxedflag=relaxedflag, nclScript=nclScript, map=map, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -347,22 +347,22 @@ subroutine LIS_ESMF_GridWrite_preset(grid, nclScript, mapPreset, & call LIS_ESMF_GridWrite(grid, fileName=fileName, overwrite=overwrite, & timeslice=timeslice, iofmt=iofmt, relaxedflag=relaxedflag, & nclScript=nclScript, map=LIS_ESMF_MAPPRESET_GLOBAL, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return case ('conus','CONUS','Conus') call LIS_ESMF_GridWrite(grid, fileName=fileName, overwrite=overwrite, & timeslice=timeslice, iofmt=iofmt, relaxedflag=relaxedflag, & nclScript=nclScript, map=LIS_ESMF_MAPPRESET_CONUS, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return case ('irene','IRENE','Irene') call LIS_ESMF_GridWrite(grid, fileName=fileName, overwrite=overwrite, & timeslice=timeslice, iofmt=iofmt, relaxedflag=relaxedflag, & nclScript=nclScript, map=LIS_ESMF_MAPPRESET_IRENE, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return case ('frontrange','FRONTRANGE','FrontRange') call LIS_ESMF_GridWrite(grid, fileName=fileName, overwrite=overwrite, & timeslice=timeslice, iofmt=iofmt, relaxedflag=relaxedflag, & nclScript=nclScript, map=LIS_ESMF_MAPPRESET_FRONTRANGE, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return case default call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_VALUE, & msg="Unknown map preset value "//trim(mapPreset)//".", & @@ -480,56 +480,56 @@ subroutine LIS_ESMF_GridWrite_default(grid, fileName, overwrite, status, & lfileName = trim(fileName) else call ESMF_GridGet(grid, name=gridName, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return lfileName = trim(gridName)//".nc" endif arraybundle = ESMF_ArrayBundleCreate(rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! -- centers -- call ESMF_GridGetCoord(grid, staggerLoc=ESMF_STAGGERLOC_CENTER, & isPresent=isPresent, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (isPresent) then call ESMF_GridGetCoord(grid, coordDim=1, & staggerLoc=ESMF_STAGGERLOC_CENTER, array=array, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArraySet(array, name="lon_center", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_GridGetCoord(grid, coordDim=2, & staggerLoc=ESMF_STAGGERLOC_CENTER, array=array, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArraySet(array, name="lat_center", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif ! -- corners -- call ESMF_GridGetCoord(grid, staggerLoc=ESMF_STAGGERLOC_CORNER, & isPresent=hasCorners, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (hasCorners) then call ESMF_GridGetCoord(grid, coordDim=1, & staggerLoc=ESMF_STAGGERLOC_CORNER, array=array, rc=rc) if (.not. ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) then call ESMF_ArraySet(array, name="lon_corner", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif call ESMF_GridGetCoord(grid, coordDim=2, & staggerLoc=ESMF_STAGGERLOC_CORNER, array=array, rc=rc) if (.not. ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) then call ESMF_ArraySet(array, name="lat_corner", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif endif @@ -537,38 +537,38 @@ subroutine LIS_ESMF_GridWrite_default(grid, fileName, overwrite, status, & call ESMF_GridGetItem(grid, itemflag=ESMF_GRIDITEM_MASK, & staggerLoc=ESMF_STAGGERLOC_CENTER, isPresent=isPresent, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (isPresent) then call ESMF_GridGetItem(grid, staggerLoc=ESMF_STAGGERLOC_CENTER, & itemflag=ESMF_GRIDITEM_MASK, array=array, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArraySet(array, name="mask", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif ! -- area -- call ESMF_GridGetItem(grid, itemflag=ESMF_GRIDITEM_AREA, & staggerLoc=ESMF_STAGGERLOC_CENTER, isPresent=isPresent, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (isPresent) then call ESMF_GridGetItem(grid, staggerLoc=ESMF_STAGGERLOC_CENTER, & itemflag=ESMF_GRIDITEM_AREA, array=array, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArraySet(array, name="area", rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleAdd(arraybundle,(/array/),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif call ESMF_ArrayBundleWrite(arraybundle, & fileName=trim(lfileName),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_ArrayBundleDestroy(arraybundle,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (present(nclScript)) then lnclScript = nclScript @@ -578,18 +578,18 @@ subroutine LIS_ESMF_GridWrite_default(grid, fileName, overwrite, status, & if (lnclScript) then call ESMF_GridGet(grid,dimCount=dimCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! allocate coordDim info accord. to dimCount and tileCount allocate(coordDimCount(dimCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return ! get coordDim info call ESMF_GridGet(grid, coordDimCount=coordDimCount, & rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return coordDimMax = 0 do dimIndex=1,dimCount @@ -600,7 +600,7 @@ subroutine LIS_ESMF_GridWrite_default(grid, fileName, overwrite, status, & deallocate(coordDimCount, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return endif endif @@ -703,36 +703,36 @@ subroutine LIS_ESMF_DecompWrite(grid, fileName, overwrite, status, & lfileName = trim(fileName) else call ESMF_GridGet(grid, name=gridName, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return lfileName = trim(gridName)//"_decomp.nc" endif call ESMF_GridGet(grid, rank=rank, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if ( rank .ne. 2) then call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported grid rank.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif call ESMF_VMGetGlobal(vm, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_VMGet(vm, localPet=localPet, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return field = ESMF_FieldCreate(grid, typekind=ESMF_TYPEKIND_I4, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_FieldGet(field, localDeCount=localDeCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return nullify(farrayPtr) do deIndex=1, localDeCount call ESMF_FieldGet(field, localDe=deIndex, farrayPtr=farrayPtr, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farrayPtr(:,:) = localPet nullify(farrayPtr) @@ -740,10 +740,10 @@ subroutine LIS_ESMF_DecompWrite(grid, fileName, overwrite, status, & call ESMF_FieldWrite(field, fileName=lfileName, variableName="decomp", & overwrite=overwrite, status=status, iofmt=iofmt, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_FieldDestroy(field, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif @@ -829,7 +829,7 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field, typekind=typekind, rank=rank, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return l_member = 1 if(present(member)) l_member = member @@ -845,22 +845,22 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & allocate(coordDimCount(rank)) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return if (trim(l_dataFillScheme)=="sincos") then call ESMF_FieldGet(field, grid=grid, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_GridGet(grid,coordTypeKind=coordTypeKind, & coordDimCount=coordDimCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank==1) then ! 1D sin pattern ! TODO: support Meshes call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR8D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (typekind==ESMF_TYPEKIND_R4) then call ESMF_FieldGet(field, farrayPtr=dataPtrR4D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do i=lbound(dataPtrR4D1,1),ubound(dataPtrR4D1,1) dataPtrR4D1(i) = & (sin(real(l_member)*3.1416*(coord1PtrR8D1(i)+real(l_step))/180.)) * & @@ -868,7 +868,7 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & enddo elseif (typekind==ESMF_TYPEKIND_R8) then call ESMF_FieldGet(field, farrayPtr=dataPtrR8D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do i=lbound(dataPtrR8D1,1),ubound(dataPtrR8D1,1) dataPtrR8D1(i) = & (sin(real(l_member)*3.1416*(coord1PtrR8D1(i)+real(l_step))/180.)) * & @@ -878,7 +878,7 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported typekind-rank and scheme combination requested.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif elseif (rank==2) then ! 2D sin*cos pattern @@ -886,47 +886,47 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & if (coordTypeKind==ESMF_TYPEKIND_R4) then if (coordDimCount(1)==1) then call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR4D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else ! assume the only other choice here is 2D, if not will trigger error call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR4D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif if (coordDimCount(2)==1) then call ESMF_GridGetCoord(grid, coordDim=2, farrayPtr=coord2PtrR4D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else ! assume the only other choice here is 2D, if not will trigger error call ESMF_GridGetCoord(grid, coordDim=2, farrayPtr=coord2PtrR4D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif elseif (coordTypeKind==ESMF_TYPEKIND_R8) then if (coordDimCount(1)==1) then call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR8D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else ! assume the only other choice here is 2D, if not will trigger error call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR8D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif if (coordDimCount(2)==1) then call ESMF_GridGetCoord(grid, coordDim=2, farrayPtr=coord2PtrR8D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else ! assume the only other choice here is 2D, if not will trigger error call ESMF_GridGetCoord(grid, coordDim=2, farrayPtr=coord2PtrR8D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif else call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported coordinate typekind.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif if (typekind==ESMF_TYPEKIND_R4) then call ESMF_FieldGet(field, farrayPtr=dataPtrR4D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (coordDimCount(1)==1 .and. coordDimCount(2)==1) then if (coordTypeKind==ESMF_TYPEKIND_R4) then do j=lbound(dataPtrR4D2,2),ubound(dataPtrR4D2,2) @@ -1011,7 +1011,7 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & endif elseif (typekind==ESMF_TYPEKIND_R8) then call ESMF_FieldGet(field, farrayPtr=dataPtrR8D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (coordDimCount(1)==1 .and. coordDimCount(2)==1) then if (coordTypeKind==ESMF_TYPEKIND_R4) then do j=lbound(dataPtrR8D2,2),ubound(dataPtrR8D2,2) @@ -1098,21 +1098,21 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported typekind-rank and scheme combination requested.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif elseif (rank==3) then ! 3D sin*cos*sin pattern ! TODO: support Meshes call ESMF_GridGetCoord(grid, coordDim=1, farrayPtr=coord1PtrR8D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_GridGetCoord(grid, coordDim=2, farrayPtr=coord2PtrR8D3, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) & - return ! bail out + return call ESMF_GridGetCoord(grid, coordDim=3, farrayPtr=coord3PtrR8D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (typekind==ESMF_TYPEKIND_R4) then call ESMF_FieldGet(field, farrayPtr=dataPtrR4D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do k=lbound(dataPtrR4D3,3),ubound(dataPtrR4D3,3) do j=lbound(dataPtrR4D3,2),ubound(dataPtrR4D3,2) do i=lbound(dataPtrR4D3,1),ubound(dataPtrR4D3,1) @@ -1126,7 +1126,7 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & enddo elseif (typekind==ESMF_TYPEKIND_R8) then call ESMF_FieldGet(field, farrayPtr=dataPtrR8D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do k=lbound(dataPtrR8D3,3),ubound(dataPtrR8D3,3) do j=lbound(dataPtrR8D3,2),ubound(dataPtrR8D3,2) do i=lbound(dataPtrR8D3,1),ubound(dataPtrR8D3,1) @@ -1142,49 +1142,49 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported typekind-rank and scheme combination requested.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif else call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unsupported typekind-rank and scheme combination requested.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif else if (trim(dataFillScheme)=="one") then if (typekind==ESMF_TYPEKIND_R8 .and. rank==1) then ! 1D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR8D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR8D1 = 1._ESMF_KIND_R8 elseif (typekind==ESMF_TYPEKIND_R4 .and. rank==1) then ! 1D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR4D1, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR4D1 = 1._ESMF_KIND_R4 elseif (typekind==ESMF_TYPEKIND_R8 .and. rank==2) then ! 2D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR8D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR8D2 = 1._ESMF_KIND_R8 elseif (typekind==ESMF_TYPEKIND_R4 .and. rank==2) then ! 2D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR4D2, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR4D2 = 1._ESMF_KIND_R4 elseif (typekind==ESMF_TYPEKIND_R8 .and. rank==3) then ! 3D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR8D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR8D3 = 1._ESMF_KIND_R8 elseif (typekind==ESMF_TYPEKIND_R4 .and. rank==3) then ! 3D all 1. call ESMF_FieldGet(field, farrayPtr=dataPtrR4D3, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! initialize the entire array dataPtrR4D3 = 1._ESMF_KIND_R4 endif @@ -1192,13 +1192,13 @@ subroutine LIS_ESMF_FieldFill(field, keywordEnforcer, & call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Unknown dataFillScheme requested.", & CONTEXT, rcToReturn=rc) - return ! bail out + return endif deallocate(coordDimCount,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1235,31 +1235,31 @@ subroutine LIS_ESMF_FillState_I4(state,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_StateGet(state,itemCount=itemCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount), itemTypeList(itemCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state,itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex = 1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then call ESMF_StateGet(state,field=field, & itemName=itemNameList(iIndex),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillField(field,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif enddo deallocate(itemNameList, itemTypeList, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1296,31 +1296,31 @@ subroutine LIS_ESMF_FillState_I8(state,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_StateGet(state,itemCount=itemCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount), itemTypeList(itemCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state,itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex = 1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then call ESMF_StateGet(state,field=field, & itemName=itemNameList(iIndex),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillField(field,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif enddo deallocate(itemNameList, itemTypeList, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1357,31 +1357,31 @@ subroutine LIS_ESMF_FillState_R4(state,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_StateGet(state,itemCount=itemCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount), itemTypeList(itemCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state,itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex = 1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then call ESMF_StateGet(state,field=field, & itemName=itemNameList(iIndex),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillField(field,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif enddo deallocate(itemNameList, itemTypeList, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1418,31 +1418,31 @@ subroutine LIS_ESMF_FillState_R8(state,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_StateGet(state,itemCount=itemCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount), itemTypeList(itemCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state,itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex = 1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then call ESMF_StateGet(state,field=field, & itemName=itemNameList(iIndex),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillField(field,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return endif enddo deallocate(itemNameList, itemTypeList, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1481,26 +1481,26 @@ subroutine LIS_ESMF_FillState_SCHEME(state,dataFillScheme,step,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_StateGet(state,itemCount=itemCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount), itemTypeList(itemCount), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state,itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return k=1 ! initialize do iIndex = 1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then call ESMF_StateGet(state,field=field, & itemName=itemNameList(iIndex),rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call ESMF_FieldFill(field, dataFillScheme=dataFillScheme, & member=k, step=step, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return k=k+1 ! increment the member counter endif enddo @@ -1508,7 +1508,7 @@ subroutine LIS_ESMF_FillState_SCHEME(state,dataFillScheme,step,rc) deallocate(itemNameList, itemTypeList, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of state item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1544,26 +1544,26 @@ subroutine LIS_ESMF_FillFieldBundle_I4(fieldbundle,value,rc) call ESMF_FieldBundleGet(fieldbundle, & fieldCount=fieldCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(fieldList(fieldCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_FieldBundleGet(fieldbundle, & fieldList=fieldList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do fIndex=1,fieldCount call LIS_ESMF_FillField(fieldList(fIndex),value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo deallocate(fieldList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1599,26 +1599,26 @@ subroutine LIS_ESMF_FillFieldBundle_I8(fieldbundle,value,rc) call ESMF_FieldBundleGet(fieldbundle, & fieldCount=fieldCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(fieldList(fieldCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_FieldBundleGet(fieldbundle, & fieldList=fieldList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do fIndex=1,fieldCount call LIS_ESMF_FillField(fieldList(fIndex),value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo deallocate(fieldList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1654,26 +1654,26 @@ subroutine LIS_ESMF_FillFieldBundle_R4(fieldbundle,value,rc) call ESMF_FieldBundleGet(fieldbundle, & fieldCount=fieldCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(fieldList(fieldCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_FieldBundleGet(fieldbundle, & fieldList=fieldList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do fIndex=1,fieldCount call LIS_ESMF_FillField(fieldList(fIndex),value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo deallocate(fieldList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1709,26 +1709,26 @@ subroutine LIS_ESMF_FillFieldBundle_R8(fieldbundle,value,rc) call ESMF_FieldBundleGet(fieldbundle, & fieldCount=fieldCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(fieldList(fieldCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_FieldBundleGet(fieldbundle, & fieldList=fieldList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do fIndex=1,fieldCount call LIS_ESMF_FillField(fieldList(fIndex),value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo deallocate(fieldList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1765,27 +1765,27 @@ subroutine LIS_ESMF_FillFieldBundle_SCHEME(fieldbundle,dataFillScheme,step,rc) call ESMF_FieldBundleGet(fieldbundle, & fieldCount=fieldCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(fieldList(fieldCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_FieldBundleGet(fieldbundle, & fieldList=fieldList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do fIndex=1,fieldCount call ESMF_FieldFill(fieldList(fIndex), dataFillScheme=dataFillScheme, & member=fIndex, step=step, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo deallocate(fieldList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of field lists failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -1817,10 +1817,10 @@ subroutine LIS_ESMF_FillField_I4(field,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillArray(array,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -1852,10 +1852,10 @@ subroutine LIS_ESMF_FillField_I8(field,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillArray(array,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -1887,10 +1887,10 @@ subroutine LIS_ESMF_FillField_R4(field,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillArray(array,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -1922,10 +1922,10 @@ subroutine LIS_ESMF_FillField_R8(field,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_FillArray(array,value=value,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -1972,31 +1972,31 @@ subroutine LIS_ESMF_FillArray_I4(array,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_ArrayGet(array,typekind=typekind,rank=rank,localDeCount=localDeCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank == 1) then if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I41D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I81D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R41D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R81D = value enddo else @@ -2009,25 +2009,25 @@ subroutine LIS_ESMF_FillArray_I4(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I42D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I82D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R42D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R82D = value enddo else @@ -2040,25 +2040,25 @@ subroutine LIS_ESMF_FillArray_I4(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I43D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I83D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R43D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R83D = value enddo else @@ -2119,31 +2119,31 @@ subroutine LIS_ESMF_FillArray_I8(array,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_ArrayGet(array,typekind=typekind,rank=rank,localDeCount=localDeCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank == 1) then if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I41D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I81D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R41D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R81D = value enddo else @@ -2156,25 +2156,25 @@ subroutine LIS_ESMF_FillArray_I8(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I42D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I82D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R42D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R82D = value enddo else @@ -2187,25 +2187,25 @@ subroutine LIS_ESMF_FillArray_I8(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I43D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I83D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R43D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R83D = value enddo else @@ -2266,31 +2266,31 @@ subroutine LIS_ESMF_FillArray_R4(array,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_ArrayGet(array,typekind=typekind,rank=rank,localDeCount=localDeCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank == 1) then if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I41D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I81D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R41D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R81D = value enddo else @@ -2303,25 +2303,25 @@ subroutine LIS_ESMF_FillArray_R4(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I42D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I82D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R42D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R82D = value enddo else @@ -2334,25 +2334,25 @@ subroutine LIS_ESMF_FillArray_R4(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I43D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I83D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R43D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R83D = value enddo else @@ -2413,31 +2413,31 @@ subroutine LIS_ESMF_FillArray_R8(array,value,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_ArrayGet(array,typekind=typekind,rank=rank,localDeCount=localDeCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank == 1) then if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I41D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I81D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R41D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R41D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R81D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R81D = value enddo else @@ -2450,25 +2450,25 @@ subroutine LIS_ESMF_FillArray_R8(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I42D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I82D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R42D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R82D = value enddo else @@ -2481,25 +2481,25 @@ subroutine LIS_ESMF_FillArray_R8(array,value,rc) if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I43D = value enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_I83D = value enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R43D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R43D = value enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R83D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return farray_R83D = value enddo else @@ -2610,10 +2610,10 @@ subroutine LIS_ESMF_NetcdfReadIXJX_Field(varname,filename,start,field,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_FieldGet(field,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_NetcdfReadIXJX(varname,filename,start,array=array,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -2654,36 +2654,36 @@ subroutine LIS_ESMF_NetcdfReadIXJX_Array(varname,filename,start,array,rc) if (present(rc)) rc = ESMF_SUCCESS call ESMF_ArrayGet(array,typekind=typekind,rank=rank,localDeCount=localDeCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (rank == 2) then if (typekind == ESMF_TYPEKIND_I4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_NetcdfReadIXJX(varname,filename,start,farray=farray_I42D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo elseif (typekind == ESMF_TYPEKIND_I8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_I82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_NetcdfReadIXJX(varname,filename,start,farray=farray_I82D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo elseif (typekind == ESMF_TYPEKIND_R4) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R42D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_NetcdfReadIXJX(varname,filename,start,farray=farray_R42D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo elseif (typekind == ESMF_TYPEKIND_R8) then do deIndex=0,localDeCount-1 call ESMF_ArrayGet(array,farrayPtr=farray_R82D,localDe=deIndex,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_NetcdfReadIXJX(varname,filename,start,farray=farray_R82D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo else call ESMF_LogSetError(rcToCheck=ESMF_RC_ARG_RANK, & @@ -3169,7 +3169,7 @@ subroutine LIS_ESMF_LogStateList(stateList,nestedFlag,label,rc) do sIndex=1, size(stateList) call LIS_ESMF_LogState(stateList(sIndex),nestedFlag,label,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo end subroutine @@ -3227,18 +3227,18 @@ subroutine LIS_ESMF_LogState(state,nestedFlag,label,fvalues,rc) call ESMF_StateGet(state, nestedFlag=nestedFlag, & itemCount=itemCount, name=stateName, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (itemCount > 0 ) then allocate(itemNameList(itemCount),itemTypeList(itemCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state, nestedFlag=nestedFlag, & itemNameList=itemNameList,itemTypeList=itemTypeList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex=1, itemCount @@ -3269,7 +3269,7 @@ subroutine LIS_ESMF_LogState(state,nestedFlag,label,fvalues,rc) deallocate(itemNameList,itemTypeList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of item list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return else write (logMsg,"(A,A)") trim(llabel)//": ", & @@ -3315,7 +3315,7 @@ subroutine LIS_ESMF_LogFieldConnections(state,nestedFlag,label,rc) call ESMF_StateGet(state, itemCount=itemCount, & nestedFlag=nestedFlag,name=stateName,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if(present(label)) then llabel = trim(label) @@ -3325,16 +3325,16 @@ subroutine LIS_ESMF_LogFieldConnections(state,nestedFlag,label,rc) call ESMF_StateGet(state, itemCount=itemCount, & nestedFlag=nestedFlag,name=stateName,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return allocate(itemNameList(itemCount),itemTypeList(itemCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of item name and type list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call ESMF_StateGet(state, itemNameList=itemNameList, & itemTypeList=itemTypeList, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do iIndex=1, itemCount if (itemTypeList(iIndex) /= ESMF_STATEITEM_FIELD) then @@ -3353,7 +3353,7 @@ subroutine LIS_ESMF_LogFieldConnections(state,nestedFlag,label,rc) deallocate(itemNameList,itemTypeList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of item name and type list memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -3405,19 +3405,19 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) call ESMF_GridGet(grid, name=gridName, & localDeCount=localDeCount, distgrid=distgrid, & dimCount=dimCount,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! allocate coordDim info accord. to dimCount and tileCount allocate(coordDimCount(dimCount), & stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return ! get coordDim info call ESMF_GridGet(grid, coordDimCount=coordDimCount, & rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return coordDimMax = 0 do dimIndex=1,dimCount @@ -3435,7 +3435,7 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Dellocation of coordinate dimensions memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return write (logMsg,"(A,A,(A,I0))") trim(llabel)//": ", & trim(gridName), & @@ -3445,7 +3445,7 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) ! get dimCount and tileCount call ESMF_DistGridGet(distgrid, dimCount=dimCount, tileCount=tileCount, & deCount=deCount, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return write (logMsg,"(A,A,(A,I0))") trim(llabel)//": ", & trim(gridName), & @@ -3465,12 +3465,12 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) maxIndexPTile(dimCount, tileCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of index array memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return ! get minIndex and maxIndex arrays call ESMF_DistGridGet(distgrid, minIndexPTile=minIndexPTile, & maxIndexPTile=maxIndexPTile, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do tileIndex=1,tileCount do dimIndex=1,dimCount @@ -3487,19 +3487,19 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) deallocate(minIndexPTile, maxIndexPTile,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of index array memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return ! allocate minIndexPDe and maxIndexPDe accord. to dimCount and deCount allocate(minIndexPDe(dimCount, deCount), & maxIndexPDe(dimCount, deCount),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of index array memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return ! get minIndex and maxIndex arrays call ESMF_DistGridGet(distgrid, minIndexPDe=minIndexPDe, & maxIndexPDe=maxIndexPDe, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return do deIndex=1,deCount do dimIndex=1,dimCount @@ -3516,7 +3516,7 @@ subroutine LIS_ESMF_LogGrid(grid,label,rc) deallocate(minIndexPDe, maxIndexPDe,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of index array memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return end subroutine #undef METHOD @@ -3556,7 +3556,7 @@ subroutine LIS_ESMF_LogFieldList(fieldList,label,rc) do fIndex=1,size(fieldList) call LIS_ESMF_LogField(fieldList(fIndex),llabel,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return enddo end subroutine @@ -3605,7 +3605,7 @@ subroutine LIS_ESMF_LogField(field,label,rc) endif call ESMF_FieldGet(field,status=fieldStatus,name=fieldName,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (fieldStatus == ESMF_FIELDSTATUS_EMPTY) then fieldStatusStr = 'EMPTY' @@ -3620,7 +3620,7 @@ subroutine LIS_ESMF_LogField(field,label,rc) if (fieldStatus == ESMF_FIELDSTATUS_COMPLETE .OR. & fieldStatus == ESMF_FIELDSTATUS_GRIDSET ) then call ESMF_FieldGet(field, geomtype=fieldGeomtype,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (fieldGeomtype == ESMF_GEOMTYPE_GRID) then fieldGeomtypeStr = 'GRID' elseif (fieldGeomtype == ESMF_GEOMTYPE_MESH) then @@ -3638,15 +3638,15 @@ subroutine LIS_ESMF_LogField(field,label,rc) call NUOPC_GetAttribute(field, name="ConsumerConnection", & value=fieldConsumerConn, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call NUOPC_GetAttribute(field, name="TransferOfferGeomObject", & value=fieldTransferOffer, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call NUOPC_GetAttribute(field, name="TransferActionGeomObject", & value=fieldTransferAction, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return write (logMsg,"(A,A,(2A))") trim(llabel)//": ", & trim(fieldName), & @@ -3704,10 +3704,10 @@ subroutine LIS_ESMF_LogFieldLclVal(field, label, rc) endif call ESMF_FieldGet(field,array=array,name=fieldName,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogArrayLclVal(array,fieldName=fieldName,label=llabel,rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return end subroutine #undef METHOD @@ -3760,27 +3760,27 @@ subroutine LIS_ESMF_LogArrayLclVal(array, fieldName, label, rc) endif call ESMF_ArrayGet(array, typekind=typekind,rank=rank, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (typekind == ESMF_TYPEKIND_I4) then if (rank == 1) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I4_1D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I4_1D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 2) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I4_2D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I4_2D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 3) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I4_3D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I4_3D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else call ESMF_LogWrite(trim(llabel)//" rank out of log utility range.", & ESMF_LOGMSG_INFO) @@ -3788,22 +3788,22 @@ subroutine LIS_ESMF_LogArrayLclVal(array, fieldName, label, rc) elseif (typekind == ESMF_TYPEKIND_I8) then if (rank == 1) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I8_1D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I8_1D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 2) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I8_2D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I8_2D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 3) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_I8_3D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_I8_3D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else call ESMF_LogWrite(trim(llabel)//" rank out of log uttility range.", & ESMF_LOGMSG_INFO) @@ -3811,22 +3811,22 @@ subroutine LIS_ESMF_LogArrayLclVal(array, fieldName, label, rc) elseif (typekind == ESMF_TYPEKIND_R4) then if (rank == 1) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R4_1D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R4_1D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 2) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R4_2D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R4_2D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 3) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R4_3D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R4_3D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else call ESMF_LogWrite(trim(llabel)//" rank out of log utility range.", & ESMF_LOGMSG_INFO) @@ -3834,22 +3834,22 @@ subroutine LIS_ESMF_LogArrayLclVal(array, fieldName, label, rc) elseif (typekind == ESMF_TYPEKIND_R8) then if (rank == 1) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R8_1D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R8_1D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 2) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R8_2D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R8_2D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return elseif (rank == 3) then call ESMF_ArrayGet(array, farrayPtr=dataPtr_R8_3D, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return call LIS_ESMF_LogFarrayLclVal(dataPtr_R8_3D, fieldName=fieldName, & label=trim(llabel), rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else call ESMF_LogWrite(trim(llabel)//" rank out of log utility range.", & ESMF_LOGMSG_INFO) @@ -4514,21 +4514,21 @@ subroutine LIS_ESMF_LogCplList(cplcomp,label,rc) ! query the CplComp for info call ESMF_CplCompGet(cplcomp, name=name, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! get the CplList Attribute call NUOPC_CompAttributeGet(cplcomp, name="CplList", & itemCount=cplListSize, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return if (cplListSize>0) then allocate(cplList(cplListSize), stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of internal CplList memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return call NUOPC_CompAttributeGet(cplcomp, name="CplList", valueList=cplList, & rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return ! bail out + if (ESMF_LogFoundError(rcToCheck=rc, PASSTHRU)) return else write (logMsg,"(A,A,A)") trim(llabel)//": ", & trim(name), & @@ -4550,7 +4550,7 @@ subroutine LIS_ESMF_LogCplList(cplcomp,label,rc) deallocate(cplList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg="Deallocation of internal CplList memory failed.", & - CONTEXT, rcToReturn=rc)) return ! bail out + CONTEXT, rcToReturn=rc)) return endif end subroutine diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 index 171ec96a9..c6ec09fc5 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 @@ -297,46 +297,46 @@ subroutine SetServices(gcomp, rc) allocate(is%wrap, stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg='Allocation of internal state memory failed.', & - line=__LINE__, file=__FILE__, rcToReturn=rc)) return ! bail out + line=__LINE__, file=__FILE__, rcToReturn=rc)) return call ESMF_UserCompSetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! the NUOPC model component will register the generic methods call NUOPC_CompDerive(gcomp, model_routine_SS, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! switching to IPD versions call ESMF_GridCompSetEntryPoint(gcomp, ESMF_METHOD_INITIALIZE, & userRoutine=InitializeP0, phase=0, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! set entry point for methods that require specific implementation call NUOPC_CompSetEntryPoint(gcomp, ESMF_METHOD_INITIALIZE, & phaseLabelList=(/"IPDv03p1"/), userRoutine=InitializeP1, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSetEntryPoint(gcomp, ESMF_METHOD_INITIALIZE, & phaseLabelList=(/"IPDv03p3"/), userRoutine=InitializeP3, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! attach specializing method(s) call NUOPC_CompSpecialize(gcomp, specLabel=model_label_DataInitialize, & specRoutine=DataInitialize, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSpecialize(gcomp, speclabel=model_label_SetClock, & specRoutine=SetClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_MethodRemove(gcomp, label=model_label_CheckImport, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail ou + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSpecialize(gcomp, specLabel=model_label_CheckImport, & specRoutine=CheckImport, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail ou + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSpecialize(gcomp, speclabel=model_label_Advance, & specRoutine=ModelAdvance, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSpecialize(gcomp, specLabel=model_label_Finalize, & specRoutine=ModelFinalize, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return end subroutine @@ -360,40 +360,40 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Switch to IPDv03 by filtering all other phaseMap entries call NUOPC_CompFilterPhaseMap(gcomp, ESMF_METHOD_INITIALIZE, & acceptStringList=(/"IPDv03p"/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call LIS_AttributeGet(rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! prepare diagnostics folder if (btest(diagnostic,16)) then call ESMF_UtilIOMkDir(pathName=trim(is%wrap%dirOutput), & relaxedFlag=.true., rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif contains ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -409,57 +409,57 @@ subroutine LIS_AttributeGet(rc) ! check gcomp for config call ESMF_GridCompGet(gcomp, configIsPresent=configIsPresent, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! read and ingest free format component attributes if (configIsPresent) then call ESMF_GridCompGet(gcomp, config=config, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return attrFF = NUOPC_FreeFormatCreate(config, & label=trim(cname)//"_attributes::", relaxedflag=.true., rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompAttributeIngest(gcomp, attrFF, addFlag=.true., rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_FreeFormatDestroy(attrFF, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif ! Realize all export fields call ESMF_AttributeGet(gcomp, name="realize_all_export", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%realizeAllExport = (trim(value)=="true") ! Set configuration file name call ESMF_AttributeGet(gcomp, name="config_file", value=value, & defaultValue="lis.config", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%configFile=value ! Turn on nest coupling call ESMF_AttributeGet(gcomp, name="nest_to_nest", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%nestToNest = (trim(value)=="true") ! Turn on ensemble coupling call ESMF_AttributeGet(gcomp, name="coupled_ensemble", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%cplEns = (trim(value)=="true") ! Realize all export fields call ESMF_AttributeGet(gcomp, name="import_dependency", & value=value, defaultValue="false", & convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%importDependency = (trim(value)=="true") ! Get component output directory call ESMF_AttributeGet(gcomp, name="output_directory", & value=value, defaultValue=trim(cname)//"_OUTPUT", & convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%dirOutput = trim(value) if (btest(verbosity,16)) then @@ -519,51 +519,51 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, petCount=petCount, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! initialize lis model for this PET call LIS_NUOPC_Init(vm, configFile=is%wrap%configFile, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (btest(verbosity,16)) then call LIS_Log(trim(cname)//': '//rname,rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif call LIS_FieldDictionaryAdd(rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%nnests = LIS_NestCntGet(rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Max nest check if ( is%wrap%nnests > MAXNEST ) then call ESMF_LogSetError(ESMF_FAILURE, & msg="Maximum nest size is 999,999,999.", & line=__LINE__,file=__FILE__,rcToReturn=rc) - return ! bail out + return endif allocate( & @@ -578,7 +578,7 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of internal state nest memory failed.", & line=__LINE__,file=__FILE__)) & - return ! bail out + return is%wrap%modes=LIS_Unknown @@ -594,7 +594,7 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) call ESMF_LogSetError(ESMF_FAILURE, & msg="Nest to nest must be turned on when multiple domains exist.", & line=__LINE__,file=__FILE__,rcToReturn=rc) - return ! bail out + return endif else ! add namespace @@ -602,12 +602,12 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) CplSet="1", & nestedStateName="NestedStateImp_N1", & nestedState=is%wrap%NStateImp(1), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_AddNestedState(exportState, & CplSet="1", & nestedStateName="NestedStateExp_N1", & nestedState=is%wrap%NStateExp(1), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif do nIndex = 2, is%wrap%nnests @@ -616,12 +616,12 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) CplSet=trim(nStr), & nestedStateName="NestedStateImp_N"//trim(nStr), & nestedState=is%wrap%NStateImp(nIndex), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_AddNestedState(exportState, & CplSet=trim(nStr), & nestedStateName="NestedStateExp_N"//trim(nStr), & nestedState=is%wrap%NStateExp(nIndex), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return enddo #endif @@ -635,14 +635,14 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) standardName=trim(LIS_FieldList(fIndex)%stdname), & name=trim(LIS_FieldList(fIndex)%stateName), & rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif if (LIS_FieldList(fIndex)%adExport) then call NUOPC_Advertise(is%wrap%NStateExp(nIndex), & standardName=trim(LIS_FieldList(fIndex)%stdname), & name=trim(LIS_FieldList(fIndex)%stateName), & rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif enddo enddo @@ -729,26 +729,26 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return do nIndex = 1, is%wrap%nnests write (nStr,"(I0)") nIndex @@ -757,19 +757,19 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) if (is%wrap%cplEns) then call LIS_EnsMemberCntGet(nIndex, & is%wrap%ensMemberCnt(nIndex), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else is%wrap%ensMemberCnt(nIndex) = 0 endif ! Call gluecode to create grid. is%wrap%grids(nIndex) = LIS_GridCreate(nIndex, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (btest(verbosity,16)) then call LIS_ESMF_LogGrid(is%wrap%grids(nIndex), & trim(cname)//"_"//rname//"_D"//trim(nStr),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif ! Write grid to NetCDF file. @@ -777,7 +777,7 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) call LIS_ESMF_GridWrite(is%wrap%grids(nIndex), & trim(is%wrap%dirOutput)//"/diag_"//trim(cname)//"_"// & rname//'_grid_D'//trim(nStr)//".nc", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif do fIndex = 1, size(LIS_FieldList) @@ -803,15 +803,15 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, & ungriddedLBound=(/1/), ungriddedUBound=(/is%wrap%ensMemberCnt(nIndex)/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif call ESMF_FieldFill(field, dataFillScheme="const", & const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -835,15 +835,15 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, & ungriddedLBound=(/1/), ungriddedUBound=(/is%wrap%ensMemberCnt(nIndex)/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif call ESMF_FieldFill(field, dataFillScheme="const", & const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -859,7 +859,7 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) endif call ESMF_FieldFill(field, dataFillScheme="const", & const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateImp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedImport = .TRUE. @@ -868,15 +868,15 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, & ungriddedLBound=(/1/), ungriddedUBound=(/is%wrap%ensMemberCnt(nIndex)/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif call ESMF_FieldFill(field, dataFillScheme="const", & const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -888,15 +888,15 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, & ungriddedLBound=(/1/), ungriddedUBound=(/is%wrap%ensMemberCnt(nIndex)/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else field = ESMF_FieldCreate(name=trim(LIS_FieldList(fIndex)%stateName), & grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif call ESMF_FieldFill(field, dataFillScheme="const", & const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateImp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedImport = .TRUE. @@ -919,7 +919,7 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) if (ESMF_STDERRORCHECK(rc)) return is%wrap%modes(nIndex) = LIS_RunModeGet(LIS_FieldList,is%wrap%NStateImp(nIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return enddo @@ -1010,36 +1010,36 @@ subroutine DataInitialize(gcomp, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the Component for its clock call NUOPC_ModelGet(gcomp, modelClock=modelClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! get the current time out of the clock call ESMF_ClockGet(modelClock, currTime=currTime, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_TimeGet(currTime, timeString=currTimeStr, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return importUpdated = .TRUE. do nIndex=1,is%wrap%nnests @@ -1049,14 +1049,14 @@ subroutine DataInitialize(gcomp, rc) ! Check data dependencies importCurrent = NUOPC_IsAtTime(is%wrap%NStateImp(nIndex), & time=currTime, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (importCurrent) then call ESMF_LogWrite( & trim(cname)//': '//rname//' Initialize-Data-Dependency SATISFIED!!! Nest='//trim(nStr), & ESMF_LOGMSG_INFO) call LIS_ImportFieldsCopy(nIndex,is%wrap%NStateImp(nIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else call ESMF_LogWrite( & trim(cname)//': '//rname//' Initialize-Data-Dependency NOT YET SATISFIED!!! Nest='//trim(nStr), & @@ -1066,7 +1066,7 @@ subroutine DataInitialize(gcomp, rc) else ! Reset all import fields to zero call ESMF_StateGet(is%wrap%NStateImp(nIndex),itemCount=itemCount, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return allocate( & itemNameList(itemCount), & @@ -1076,7 +1076,7 @@ subroutine DataInitialize(gcomp, rc) msg="Allocation of state item list memory failed.", & line=__LINE__, & file=__FILE__)) & - return ! bail out + return call ESMF_StateGet(is%wrap%NStateImp(nIndex),itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) @@ -1098,17 +1098,17 @@ subroutine DataInitialize(gcomp, rc) msg="Deallocation of state item list memory failed.", & line=__LINE__, & file=__FILE__)) & - return ! bail out + return endif ! Initialize import and export fields call LIS_NUOPC_DataInit(nest=nIndex, & importState=is%wrap%NStateImp(nIndex), & exportState=is%wrap%NStateExp(nIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemCount=itemCount, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return allocate( & itemNameList(itemCount), & @@ -1118,7 +1118,7 @@ subroutine DataInitialize(gcomp, rc) msg="Allocation of state item list memory failed.", & line=__LINE__, & file=__FILE__)) & - return ! bail out + return call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemNameList=itemNameList, & itemTypeList=itemTypeList,rc=rc) @@ -1130,7 +1130,7 @@ subroutine DataInitialize(gcomp, rc) itemName=itemNameList(iIndex),rc=rc) if (ESMF_STDERRORCHECK(rc)) return call NUOPC_SetAttribute(field, name="Updated", value="true", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif enddo @@ -1139,14 +1139,14 @@ subroutine DataInitialize(gcomp, rc) msg="Deallocation of state item list memory failed.", & line=__LINE__, & file=__FILE__)) & - return ! bail out + return enddo ! enddo nnests ! set InitializeDataComplete Attribute to "true", indicating to the ! generic code that all inter-model data dependencies are satisfied if (importUpdated) then call NUOPC_CompAttributeSet(gcomp, name="InitializeDataComplete", value="true", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Write initialization files if (btest(diagnostic,16)) then do nIndex=1,is%wrap%nnests @@ -1155,12 +1155,12 @@ subroutine DataInitialize(gcomp, rc) fileNamePrefix=trim(is%wrap%dirOutput)//"/diag_"//trim(cname)//"_"// & rname//"_imp_D"//trim(nStr)//"_"//trim(currTimeStr)//"_", & overwrite=.true., status=ESMF_FILESTATUS_REPLACE, timeslice=1, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Write(is%wrap%NStateExp(nIndex), & fileNamePrefix=trim(is%wrap%dirOutput)//"/diag_"//trim(cname)//"_"// & rname//"_exp_D"//trim(nStr)//"_"//trim(currTimeStr)//"_", & overwrite=.true., status=ESMF_FILESTATUS_REPLACE, timeslice=1, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return enddo endif endif @@ -1190,59 +1190,59 @@ subroutine SetClock(gcomp, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the Component for its clock call NUOPC_ModelGet(gcomp, modelClock=modelClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Set minTimestep to the timestep of the first nest mindt = LIS_TimestepGet(nest=1,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return do nIndex = 1, is%wrap%nnests is%wrap%clocks(nIndex) = ESMF_ClockCreate(modelClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ndt = LIS_TimestepGet(nest=nIndex,rc=rc) call ESMF_TimeIntervalSet(nestTimestep, & s_r8=ndt, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_ClockSet(is%wrap%clocks(nIndex), & timeStep=nestTimestep, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (ndt < mindt) mindt = ndt call ESMF_TimeIntervalSet(is%wrap%stepAccum(nIndex), & s_r8=0._ESMF_KIND_R8, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return enddo call ESMF_TimeIntervalSet(modelTimestep, & s_r8=mindt, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call NUOPC_CompSetClock(gcomp, modelClock, & modelTimestep, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return end subroutine @@ -1273,40 +1273,40 @@ subroutine CheckImport(gcomp, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the component for its clock, importState, and exportState call NUOPC_ModelGet(gcomp, modelClock=modelClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! get the stop time out of the clock call ESMF_ClockGet(modelClock, startTime=modelStartTime, & currTime=modelCurrTime, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return do nIndex=1,is%wrap%nnests write (nStr,"(I0)") nIndex allCurrTime = NUOPC_IsAtTime(is%wrap%NStateImp(nIndex), modelCurrTime,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (.NOT.allCurrTime) then call ESMF_LogWrite(trim(cname)//": NUOPC INCOMPATIBILITY DETECTED: "// & "Import Fields Nest="//trim(nStr)//" not at correct time", & @@ -1341,26 +1341,26 @@ subroutine ModelAdvance(gcomp, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the component for its clock, importState, and exportState call NUOPC_ModelGet(gcomp, & @@ -1368,17 +1368,17 @@ subroutine ModelAdvance(gcomp, rc) importState=importState, & exportState=exportState, & rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the clock for the current time and time step call ESMF_ClockGet(modelClock, & currTime=currTime, timeStep=timeStep, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return advEndTime = currTime + timeStep call ESMF_TimeGet(currTime, timeString=currTimeStr, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_TimeGet(advEndTime, timeString=advEndTimeStr, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! HERE THE MODEL ADVANCES: currTime -> currTime + timeStep @@ -1397,13 +1397,13 @@ subroutine ModelAdvance(gcomp, rc) fileNamePrefix=trim(is%wrap%dirOutput)//"/diag_"//trim(cname)//"_"// & rname//"_imp_D"//trim(nStr)//"_"//trim(currTimeStr)//"_", & overwrite=.true., status=ESMF_FILESTATUS_REPLACE, timeslice=1, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif is%wrap%stepAccum(nIndex) = is%wrap%stepAccum(nIndex) + timeStep call ESMF_ClockGet(is%wrap%clocks(nIndex),timeStep=nestTimestep,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return do while (is%wrap%stepAccum(nIndex) >= nestTimestep) ! Gluecode NestAdvance @@ -1413,9 +1413,9 @@ subroutine ModelAdvance(gcomp, rc) call LIS_NUOPC_Run(nIndex,is%wrap%modes(nIndex), & is%wrap%NStateImp(nIndex),is%wrap%NStateExp(nIndex), & is%wrap%clocks(nIndex), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_ClockAdvance(is%wrap%clocks(nIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return is%wrap%stepAccum(nIndex) = & is%wrap%stepAccum(nIndex) - nestTimestep enddo @@ -1426,7 +1426,7 @@ subroutine ModelAdvance(gcomp, rc) fileNamePrefix=trim(is%wrap%dirOutput)//"/diag_"//trim(cname)//"_"// & rname//"_exp_D"//trim(nStr)//"_"//trim(advEndTimeStr)//"_", & overwrite=.true., status=ESMF_FILESTATUS_REPLACE, timeslice=1, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return endif enddo @@ -1469,13 +1469,13 @@ subroutine LogAdvance(nIndex) if (ESMF_ClockIsCreated(is%wrap%clocks(nIndex))) then call ESMF_ClockGet(is%wrap%clocks(nIndex), & currTime=nestCurrTime,timeStep=nestTimestep,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_TimeGet(nestCurrTime, & timeString=nCurrTimeStr,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_TimeIntervalGet(nestTimestep, & timeString=nTimestepStr,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return else nCurrTimeStr = "(not_created)" nTimestepStr = "(not_created)" @@ -1520,47 +1520,47 @@ subroutine ModelFinalize(gcomp, rc) ! Query component for name, verbosity, and diagnostic values call ESMF_GridCompGet(gcomp, name=cname, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Diagnostic", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & specialStringList=(/"min","max","bit16","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query Component for its internal State nullify(is%wrap) call ESMF_UserCompGetInternalState(gcomp, label_InternalState, is, rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! query the Component for its clock call NUOPC_ModelGet(gcomp, modelClock=modelClock, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_ClockGet(modelClock, currTime=currTime, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call ESMF_TimeGet(currTime, timeString=currTimeStr, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! finalize the LIS model do nIndex=1,is%wrap%nnests call LIS_NUOPC_Final(nIndex,modelClock,rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return enddo deallocate(is%wrap, stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg='Deallocation of internal state memory failed.', & - line=__LINE__, file=__FILE__, rcToReturn=rc)) return ! bail out + line=__LINE__, file=__FILE__, rcToReturn=rc)) return end subroutine diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 index d0ba2546a..0037026cf 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 @@ -135,11 +135,11 @@ subroutine LIS_FieldCopyToLisField(field,fieldLIS,nest,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call ESMF_FieldGet(field=fieldLIS,array=arrayLIS,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(array=array,arrayLIS=arrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -159,9 +159,9 @@ subroutine LIS_FieldCopyToLisFarray(field,farrayLIS,nest,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(array=array,farrayLIS=farrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -181,9 +181,9 @@ subroutine LIS_FieldCopyToNoah_3_3(field,stdName,nest,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoah_3_3(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -203,9 +203,9 @@ subroutine LIS_FieldCopyToNoahMP_3_6(field,stdName,nest,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_3_6(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -224,9 +224,9 @@ subroutine LIS_FieldCopyToNoahMP_4_0_1(field,stdName,nest,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_4_0_1(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -248,12 +248,12 @@ subroutine LIS_FieldCopyFromLisField(fieldLIS,field,nest,fillVal,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=fieldLIS,array=arrayLIS,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(arrayLIS=arrayLIS,array=array,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -274,10 +274,10 @@ subroutine LIS_FieldCopyFromLisFarray(farrayLIS,field,nest,fillVal,rc) rc = ESMF_SUCCESS call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS,array=array,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return end subroutine !----------------------------------------------------------------------------- @@ -326,82 +326,82 @@ subroutine LIS_ArrayCopyToLisArray(array,arrayLIS,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (rankLIS /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array is not a 1D tile array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= localDeCountLIS) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array does not match array decomposition.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (typekind /= typekindLIS) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array typekind does not match array typekind.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(typekind==ESMF_TYPEKIND_I4) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_I4,farrayLIS=farrayLIS_I4,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_I4,farrayLIS=farrayLIS_I4,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_I8) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_I8,farrayLIS=farrayLIS_I8,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_I8,farrayLIS=farrayLIS_I8,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_R4,farrayLIS=farrayLIS_R4,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_R4,farrayLIS=farrayLIS_R4,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_R8,farrayLIS=farrayLIS_R8,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_R8,farrayLIS=farrayLIS_R8,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & @@ -444,26 +444,26 @@ subroutine LIS_ArrayCopyToNoah_3_3(array,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Local DE count is not 1.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(rank==2) then if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoah_3_3(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoah_3_3(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -472,14 +472,14 @@ subroutine LIS_ArrayCopyToNoah_3_3(array,stdName,nest,rc) else if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoah_3_3(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoah_3_3(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -522,26 +522,26 @@ subroutine LIS_ArrayCopyToNoahMP_3_6(array,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Local DE count is not 1.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(rank==2) then if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_3_6(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_3_6(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -550,14 +550,14 @@ subroutine LIS_ArrayCopyToNoahMP_3_6(array,stdName,nest,rc) else if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_3_6(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_3_6(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -600,26 +600,26 @@ subroutine LIS_ArrayCopyToNoahMP_4_0_1(array,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Local DE count is not 1.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(rank==2) then if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_4_0_1(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_4_0_1(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -628,14 +628,14 @@ subroutine LIS_ArrayCopyToNoahMP_4_0_1(array,stdName,nest,rc) else if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_4_0_1(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToNoahMP_4_0_1(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -678,32 +678,32 @@ subroutine LIS_ArrayCopyToLisFarray(array,farrayLIS,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array local decomposition count must be 1.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (typekind /= ESMF_TYPEKIND_R4 .AND. typekind /= ESMF_TYPEKIND_R8) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array typekind does not match array typekind.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(rank==2) then if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_R4,farrayLIS=farrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray_R8,farrayLIS=farrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -712,14 +712,14 @@ subroutine LIS_ArrayCopyToLisFarray(array,farrayLIS,nest,rc) else if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_R4,farrayLIS=farrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(farray=farray3D_R8,farrayLIS=farrayLIS,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -775,90 +775,90 @@ subroutine LIS_ArrayCopyFromLisArray(arrayLIS,array,nest,fillVal,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (rankLIS /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array is not a 1D tile array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= localDeCountLIS) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array does not match array decomposition.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (typekind /= typekindLIS) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. LIS array typekind does not match array typekind.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(typekind==ESMF_TYPEKIND_I4) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_I4,farray=farray_I4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_I4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_I4,farray=farray3D_I4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_I8) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_I8,farray=farray_I8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_I8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_I8,farray=farray3D_I8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if(rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_R4,farray=farray_R4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_R4,farray=farray3D_R4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(arrayLIS,farrayPtr=farrayLIS_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if (rank==2) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_R8,farray=farray_R8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS_R8,farray=farray3D_R8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & @@ -902,34 +902,34 @@ subroutine LIS_ArrayCopyFromLisFarray(farrayLIS,array,nest,fillVal,rc) call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (localDeCount /= 1) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Local array decomposition count must be 1.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (typekind /= ESMF_TYPEKIND_R4 .AND. typekind /= ESMF_TYPEKIND_R8) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array typekind does not match array typekind.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if(rank==2) then if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS,farray=farray_R4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS,farray=farray_R8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -938,16 +938,16 @@ subroutine LIS_ArrayCopyFromLisFarray(farrayLIS,array,nest,fillVal,rc) else if(typekind==ESMF_TYPEKIND_R4) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS,farray=farray3D_R4,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif(typekind==ESMF_TYPEKIND_R8) then call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyFromLIS(farrayLIS=farrayLIS,farray=farray3D_R8,nest=nest,& fillVal=fillVal,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Typekind copy not implemented.",rcToReturn=rc) @@ -1178,7 +1178,7 @@ subroutine LIS_FarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -1285,7 +1285,7 @@ subroutine LIS_FarrayR4CopyToNoahMP_3_6(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -1392,7 +1392,7 @@ subroutine LIS_FarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -1499,7 +1499,7 @@ subroutine LIS_FarrayR8CopyToNoah_3_3(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -1606,7 +1606,7 @@ subroutine LIS_FarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -1712,7 +1712,7 @@ subroutine LIS_FarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -2195,7 +2195,7 @@ subroutine LIS_EnsFarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -2314,7 +2314,7 @@ subroutine LIS_EnsFarrayR4CopyToNoahMP_3_6(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -2434,7 +2434,7 @@ subroutine LIS_EnsFarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -2554,7 +2554,7 @@ subroutine LIS_EnsFarrayR8CopyToNoah_3_3(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return end select end subroutine @@ -2674,7 +2674,7 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine @@ -2793,7 +2793,7 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail ou + return end select end subroutine diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 index 09d969d93..159f21cca 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 @@ -641,7 +641,7 @@ subroutine LIS_NUOPC_Init(vm,configFile,rc) call LIS_core_init call LIS_HookupInit(rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return LIS_initialized = .true. endif @@ -681,7 +681,7 @@ subroutine LIS_NUOPC_DataInit(nest,importState,exportState,rc) call LIS_surfaceModel_setexport(nest) call LIS_ExportFieldsCopy(nest,exportState,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return #ifdef DEBUG call ESMF_LogWrite(MODNAME//": leaving "//METHOD, ESMF_LOGMSG_INFO) @@ -745,21 +745,21 @@ subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) ! use incoming clock call ESMF_ClockGet(clock, currTime=currTime, timeStep=timeStep, rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return ! LIS time manager expects end of the interval stopTime = currTime + timeStep ! Confirm if the timemgr should receive current time or stop time call ESMF_TimeGet(stopTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_timemgr_set(LIS_rc, yy, mm, dd, h, m, s, 0, 0.0) T_ENTER("datacopy") call LIS_ImportFieldsCopy(nest,importState,rc=rc) T_EXIT("datacopy") - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return T_ENTER("dynparms") call LIS_setDynparams(nest) @@ -777,12 +777,12 @@ subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Mixed (coupled+offline) met forcing data is not allowed.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Running mode is unknown.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return end select T_ENTER("pertforc") @@ -870,12 +870,12 @@ subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) call LIS_surfaceModel_setexport(nest) call LIS_ExportFieldsCopy(nest,exportState,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return ! convert runoff fields from (kg m-2 s-1) to (kg m-2) call ESMF_TimeIntervalGet(timeStep, s=timeStepSecs, rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return ! convert qs field if present call ESMF_StateGet(exportState, & @@ -973,11 +973,11 @@ subroutine LIS_NUOPC_Final(nest,clock,rc) ! use incoming clock call ESMF_ClockGet(clock, currTime=currTime, rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return ! Confirm if the timemgr should receive current time or stop time call ESMF_TimeGet(currTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_timemgr_set(LIS_rc, yy, mm, dd, h, m, s, 0, 0.0) @@ -1021,14 +1021,14 @@ subroutine LIS_HookupInit(rc) call ESMF_LogSetError(ESMF_RC_OBJ_INIT, & msg="LISWRF_export is not initialized.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif if (size(LISWRF_export) < LIS_rc%nnest) then call ESMF_LogSetError(ESMF_RC_OBJ_INIT, & msg="LISWRF_export is not initialized for each nest.", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif do fIndex=1, size(LIS_FieldList) @@ -1036,7 +1036,7 @@ subroutine LIS_HookupInit(rc) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg="Allocation of field hookup memory failed.", & line=__LINE__,file=__FILE__)) & - return ! bail out + return enddo do nIndex=1, LIS_rc%nnest @@ -1759,22 +1759,22 @@ subroutine LIS_ImportFieldsCopy(nest,importState,label,rc) call LIS_CopyToNoah_3_3(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else if (LIS_rc%lsm.eq."NoahMP.3.6") then call LIS_CopyToNoahMP_3_6(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else if (LIS_rc%lsm.eq."Noah-MP.4.0.1") then call LIS_CopyToNoahMP_4_0_1(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & msg="Direct coupling is not implemented for "//trim(LIS_rc%lsm), & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif else call LIS_ForcFieldGet(LIS_FieldList(fIndex)%lisForcVarname, & @@ -1784,11 +1784,11 @@ subroutine LIS_ImportFieldsCopy(nest,importState,label,rc) if (lisItemType == ESMF_STATEITEM_FIELD ) then call LIS_ForcFieldGet(LIS_FieldList(fIndex)%lisForcVarname, & nest=nest,field=lisImportField,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_CopyToLIS(field=importField, & fieldLIS=lisImportField, & nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else ! not present in LIS_Forc call ESMF_LogWrite( trim(l_label)// & " field is not present in LIS_Forc state="// & @@ -1865,62 +1865,62 @@ subroutine LIS_ExportFieldsCopy(nest,exportState,label,rc) call ESMF_StateGet(exportState, & itemName=trim(LIS_FieldList(fIndex)%stateName), & field=exportField,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if (LIS_FieldList(fIndex)%stateName .eq. "smliqfracl1") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smliqfracl2") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smliqfracl3") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smliqfracl4") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smfracl1") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smfracl2") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smfracl3") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "smfracl4") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=1.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "infxsrt") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=0.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return elseif (LIS_FieldList(fIndex)%stateName .eq. "soldrain") then call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,fillVal=0.0,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return else call LIS_CopyFromLIS( & farrayLIS=LIS_FieldList(fIndex)%hookup(nest)%exportArray_t, & field=exportField,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif else call ESMF_LogWrite( trim(l_label)// & @@ -1981,7 +1981,7 @@ subroutine LIS_TestFillImport(nest,importState,step,label,rc) call ESMF_StateGet(importState, & itemName=trim(LIS_FieldList(fIndex)%stateName), & field=importField,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_FieldFill(importField, dataFillScheme="sincos", & step=step, amplitude=LIS_FieldList(fIndex)%ampValue, & meanValue=LIS_FieldList(fIndex)%meanValue, rc=rc) @@ -2044,7 +2044,7 @@ subroutine LIS_TestFillExport(nest,exportState,step,label,rc) call ESMF_StateGet(exportState, & itemName=trim(LIS_FieldList(fIndex)%stateName), & field=exportField,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_FieldFill(exportField, dataFillScheme="sincos", & step=step, amplitude=LIS_FieldList(fIndex)%ampValue, & meanValue=LIS_FieldList(fIndex)%meanValue, rc=rc) @@ -2105,7 +2105,7 @@ function LIS_GridCreate(nest,rc) allocate(deBlockList(2,2,LIS_npes),petMap(LIS_npes),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg='Allocation of deBlockList and petMap memory failed.', & - line=__LINE__, file=FILENAME, rcToReturn=rc)) return ! bail out + line=__LINE__, file=FILENAME, rcToReturn=rc)) return do petID=0, LIS_npes-1 deID = petID + 1 deBlockList(1,1,deID) = LIS_ews_ind(nest,deID) ! East-West Start @@ -2116,7 +2116,7 @@ function LIS_GridCreate(nest,rc) enddo deLayout = ESMF_DELayoutCreate(petMap, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return distGrid = ESMF_DistGridCreate( & minIndex=(/1,1/), maxIndex=(/LIS_rc%gnc(nest),LIS_rc%gnr(nest)/), & @@ -2124,15 +2124,15 @@ function LIS_GridCreate(nest,rc) deBlockList=deBlockList, & delayout=deLayout, & rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call LIS_DecompGet(distgrid,istart=istart,jstart=jstart,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return deallocate(deBlockList,petMap,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg='Deallocation of deBlockList and petMap memory failed.', & - line=__LINE__,file=FILENAME,rcToReturn=rc)) return ! bail out + line=__LINE__,file=FILENAME,rcToReturn=rc)) return write(did,"(I0)") nest LIS_GridCreate = ESMF_GridCreate(name='LIS_Grid_'//trim(did), & @@ -2141,24 +2141,24 @@ function LIS_GridCreate(nest,rc) coordTypeKind=ESMF_TYPEKIND_COORD, & gridEdgeLWidth=(/0,0/), gridEdgeUWidth=(/0,1/), & rc = rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Add Center Latitude & Longitude Coordinates call ESMF_GridAddCoord(LIS_GridCreate, & staggerLoc=ESMF_STAGGERLOC_CENTER, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Get pointer to Center Latitude array call ESMF_GridGetCoord(LIS_GridCreate, coordDim=1, & staggerloc=ESMF_STAGGERLOC_CENTER, localDE=0, & computationalLBound=lbnd, computationalUBound=ubnd, & farrayPtr=coordXcenter, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Get pointer to Center Longitude array call ESMF_GridGetCoord(LIS_GridCreate, coordDim=2, & staggerloc=ESMF_STAGGERLOC_CENTER, localDE=0, & farrayPtr=coordYcenter, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! error checking ! lnc_red and lnr_red are "reduced" to not include the halo region @@ -2167,30 +2167,30 @@ function LIS_GridCreate(nest,rc) call ESMF_LogSetError(ESMF_RC_ARG_BAD, & msg="Size of local coordinate arrays not equal to size of local DE", & line=__LINE__, file=FILENAME, rcToReturn=rc) - return ! bail out + return endif call LIS_ESMF_NetcdfReadIXJX("lon",trim(LIS_rc%paramfile(nest)), & (/istart,jstart/),coordXcenter,rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_NetcdfReadIXJX("lat",trim(LIS_rc%paramfile(nest)), & (/istart,jstart/),coordYcenter,rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Add Grid Mask call ESMF_GridAddItem(LIS_GridCreate, itemFlag=ESMF_GRIDITEM_MASK, & itemTypeKind=ESMF_TYPEKIND_I4, & staggerLoc=ESMF_STAGGERLOC_CENTER, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return ! Get pointer to Grid Mask array call ESMF_GridGetItem(LIS_GridCreate, itemflag=ESMF_GRIDITEM_MASK, & localDE=0, & staggerloc=ESMF_STAGGERLOC_CENTER, & farrayPtr=gridmask, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_NetcdfReadIXJX("LANDMASK",trim(LIS_rc%paramfile(nest)), & (/istart,jstart/),gridmask,rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return #ifdef DEBUG call ESMF_LogWrite(MODNAME//": leaving "//METHOD, ESMF_LOGMSG_INFO) @@ -2223,25 +2223,25 @@ subroutine LIS_DecompGet(distgrid,istart,iend,jstart,jend,rc) allocate(indexCountPDe(2, 0:(LIS_npes - 1)),stat=stat) ! (dimCount, deCount) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg='Allocation of indexCountPDE memory failed.', & - line=__LINE__, file=FILENAME, rcToReturn=rc)) return ! bail out + line=__LINE__, file=FILENAME, rcToReturn=rc)) return call ESMF_DistGridGet(distgrid, indexCountPDe=indexCountPDe, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return allocate(iIndexList(indexCountPDe(1, LIS_localPet)),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg='Allocation of iIndexList memory failed.', & - line=__LINE__, file=FILENAME, rcToReturn=rc)) return ! bail out + line=__LINE__, file=FILENAME, rcToReturn=rc)) return call ESMF_DistGridGet(distgrid, localDe=0, dim=1, & indexList=iIndexList, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return allocate(jIndexList(indexCountPDe(2, LIS_localPet)),stat=stat) if (ESMF_LogFoundAllocError(statusToCheck=stat, & msg='Allocation of jIndexList memory failed.', & - line=__LINE__, file=FILENAME, rcToReturn=rc)) return ! bail out + line=__LINE__, file=FILENAME, rcToReturn=rc)) return call ESMF_DistGridGet(distgrid, localDe=0, dim=2, & indexList=jIndexList, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return ! bail out + if (ESMF_STDERRORCHECK(rc)) return if (present(istart)) istart = minVal(iIndexList) if (present(iend)) iend = maxVal(iIndexList) @@ -2251,11 +2251,11 @@ subroutine LIS_DecompGet(distgrid,istart,iend,jstart,jend,rc) deallocate(indexCountPDe,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg='Deallocation of indexCountPDe memory failed.', & - line=__LINE__,file=FILENAME,rcToReturn=rc)) return ! bail out + line=__LINE__,file=FILENAME,rcToReturn=rc)) return deallocate(iIndexList,jIndexList,stat=stat) if (ESMF_LogFoundDeallocError(statusToCheck=stat, & msg='Deallocation of iIndexList and jIndexList memory failed.', & - line=__LINE__,file=FILENAME,rcToReturn=rc)) return ! bail out + line=__LINE__,file=FILENAME,rcToReturn=rc)) return #ifdef DEBUG call ESMF_LogWrite(MODNAME//": leaving "//METHOD, ESMF_LOGMSG_INFO) @@ -2310,7 +2310,7 @@ subroutine LIS_ForcFieldGet(varname,nest,field,itemType,rc) call ESMF_StateGet(LIS_FORC_State(nest), & itemName=trim(varname), & field=field,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return endif endif @@ -2948,7 +2948,7 @@ subroutine LIS_FieldLog(field,label) endif call LIS_ForcFieldGet(field%lisForcVarname, & nest=nIndex,itemType=itemType,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return ! bail out + if(ESMF_STDERRORCHECK(rc)) return if (itemType == ESMF_STATEITEM_FIELD) then iAssoc = .TRUE. else From 476d99d2d62a5e87997e07988406688c2450b53b Mon Sep 17 00:00:00 2001 From: Dan Rosen Date: Tue, 26 Nov 2024 12:48:35 -0500 Subject: [PATCH 2/3] NUOPC Cap Improvements * add README file and guides * update documentation using Doxygen * add gnu/intel debug options for BUILD_TYPE=DEBUG * update missing field value to 9.99e20 * add initialization options for import and export states * add missing value check (disable with MISSINGVAL_SKPCPY or MISSINGVAL_IGNORE) * call lisfinalize during cap finalize * move configuration options to LIS_NUOPC_Flags.F90 --- lis/runmodes/nuopc_cpl_mode/Doxyfile | 839 ++++++++----- .../nuopc_cpl_mode/LIS_ESMF_Extensions.F90 | 3 + lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 | 512 ++++---- .../nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 | 1038 +++++++++-------- .../nuopc_cpl_mode/LIS_NUOPC_Flags.F90 | 211 ++++ .../nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 | 37 +- .../nuopc_cpl_mode/LIS_NUOPC_Macros.h | 2 +- lis/runmodes/nuopc_cpl_mode/Makefile | 26 +- lis/runmodes/nuopc_cpl_mode/README.md | 23 + .../nuopc_cpl_mode/docs/1_users_guide.md | 55 + .../nuopc_cpl_mode/docs/2_developers_guide.md | 73 ++ 11 files changed, 1696 insertions(+), 1123 deletions(-) create mode 100644 lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Flags.F90 create mode 100644 lis/runmodes/nuopc_cpl_mode/README.md create mode 100644 lis/runmodes/nuopc_cpl_mode/docs/1_users_guide.md create mode 100644 lis/runmodes/nuopc_cpl_mode/docs/2_developers_guide.md diff --git a/lis/runmodes/nuopc_cpl_mode/Doxyfile b/lis/runmodes/nuopc_cpl_mode/Doxyfile index 11c86ecaa..be537f1c2 100644 --- a/lis/runmodes/nuopc_cpl_mode/Doxyfile +++ b/lis/runmodes/nuopc_cpl_mode/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.12 +# Doxyfile 1.9.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -12,16 +12,26 @@ # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -58,18 +68,30 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs +OUTPUT_DIRECTORY = . -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes -# performance problems for the file system. +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. # The default value is: NO. CREATE_SUBDIRS = NO +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# numer of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode @@ -81,14 +103,14 @@ ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English @@ -189,6 +211,16 @@ SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus @@ -209,6 +241,14 @@ QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. @@ -232,20 +272,19 @@ TAB_SIZE = 4 # the documentation. An alias has the form: # name=value # For example adding -# "sideeffect=@par Side Effects:\n" +# "sideeffect=@par Side Effects:^^" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) ALIASES = -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all @@ -274,28 +313,40 @@ OPTIMIZE_FOR_FORTRAN = YES OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -307,10 +358,10 @@ MARKDOWN_SUPPORT = YES # to that level are automatically included in the table of contents, even if # they do not have an id attribute. # Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. +# Minimum value: 0, maximum value: 99, default value: 5. # This tag requires that the tag MARKDOWN_SUPPORT is set to YES. -TOC_INCLUDE_HEADINGS = 0 +TOC_INCLUDE_HEADINGS = 2 # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can @@ -337,7 +388,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -408,7 +459,7 @@ INLINE_SIMPLE_STRUCTS = NO # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. -TYPEDEF_HIDES_STRUCT = NO +TYPEDEF_HIDES_STRUCT = YES # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be @@ -423,6 +474,19 @@ TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -435,7 +499,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. @@ -443,11 +507,17 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = YES +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. -EXTRACT_PACKAGE = YES +EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. @@ -480,6 +550,13 @@ EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation @@ -497,8 +574,8 @@ HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. +# declarations. If set to NO, these declarations will be included in the +# documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO @@ -517,14 +594,22 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = SYSTEM # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the @@ -540,6 +625,12 @@ HIDE_SCOPE_NAMES = NO HIDE_COMPOUND_REFERENCE= NO +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -607,7 +698,7 @@ SORT_GROUP_NAMES = NO # list. # The default value is: NO. -SORT_BY_SCOPE_NAME = NO +SORT_BY_SCOPE_NAME = YES # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between @@ -697,7 +788,8 @@ FILE_VERSION_FILTER = # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE @@ -708,7 +800,7 @@ LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -740,26 +832,38 @@ WARNINGS = YES # will automatically be disabled. # The default value is: YES. -WARN_IF_UNDOCUMENTED = YES +WARN_IF_UNDOCUMENTED = NO # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. # The default value is: NO. WARN_AS_ERROR = NO @@ -770,13 +874,27 @@ WARN_AS_ERROR = NO # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard -# error (stderr). +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). WARN_LOGFILE = @@ -795,12 +913,23 @@ INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING # The default value is: UTF-8. INPUT_ENCODING = UTF-8 +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. @@ -809,62 +938,32 @@ INPUT_ENCODING = UTF-8 # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.h \ *.inc \ - *.m \ - *.markdown \ - *.mm \ + *.md \ *.dox \ - *.py \ - *.pyw \ *.f90 \ - *.F90 \ *.f95 \ *.f03 \ *.f08 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf + *.f18 \ + *.f # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. -RECURSIVE = NO +RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a @@ -895,7 +994,7 @@ EXCLUDE_PATTERNS = # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test +# ANamespace::AClass, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* @@ -926,7 +1025,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = docimages +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -943,6 +1042,11 @@ IMAGE_PATH = docimages # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. @@ -982,7 +1086,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1011,7 +1115,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -1043,12 +1147,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1070,25 +1174,6 @@ USE_HTAGS = NO VERBATIM_HEADERS = YES -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -CLANG_OPTIONS = - #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1100,13 +1185,6 @@ CLANG_OPTIONS = ALPHABETICAL_INDEX = YES -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored @@ -1204,10 +1282,27 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. Default setting AUTO_LIGHT +# enables light output unless the user preference is dark output. Other options +# are DARK to always use dark mode, LIGHT to always use light mode, AUTO_DARK to +# default to dark mode unless the user prefers light mode, and TOGGLE to let the +# user toggle between dark and light mode via a button. +# Possible values are: LIGHT Always generate light output., DARK Always generate +# dark output., AUTO_LIGHT Automatically set the mode according to the user +# preference, use light mode if no preference is set (the default)., AUTO_DARK +# Automatically set the mode according to the user preference, use dark mode if +# no preference is set. and TOGGLE Allow to user to switch between light and +# dark mode via a button.. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1216,7 +1311,7 @@ HTML_EXTRA_FILES = HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A +# in the HTML output. For a value of 0 the output will use gray-scales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1243,6 +1338,17 @@ HTML_COLORSTYLE_GAMMA = 80 HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1266,13 +1372,14 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1286,6 +1393,13 @@ GENERATE_DOCSET = NO DOCSET_FEEDNAME = "Doxygen generated docs" +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. @@ -1311,8 +1425,12 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML @@ -1342,7 +1460,7 @@ CHM_FILE = HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# (YES) or that it should be included in the main .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1387,7 +1505,8 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1395,8 +1514,8 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1404,30 +1523,30 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = @@ -1461,7 +1580,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag @@ -1470,15 +1589,27 @@ DISABLE_INDEX = NO # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +GENERATE_TREEVIEW = YES + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. @@ -1504,6 +1635,24 @@ TREEVIEW_WIDTH = 250 EXT_LINKS_IN_WINDOW = NO +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML @@ -1513,19 +1662,14 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. -FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side JavaScript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1535,11 +1679,29 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + # When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). # Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1552,22 +1714,29 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest +MATHJAX_RELPATH = # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. @@ -1595,7 +1764,7 @@ MATHJAX_CODEFILE = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a web server instead of a web client using Javascript. There +# implemented using a web server instead of a web client using JavaScript. There # are two flavors of web server based searching depending on the EXTERNAL_SEARCH # setting. When disabled, doxygen will generate a PHP script for searching and # an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing @@ -1614,7 +1783,8 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: +# https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1627,8 +1797,9 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and -# Searching" for details. +# Xapian (see: +# https://xapian.org/). See the section "External Indexing and Searching" for +# details. # This tag requires that the tag SEARCHENGINE is set to YES. SEARCHENGINE_URL = @@ -1666,7 +1837,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1679,21 +1850,35 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_CMD_NAME = latex +LATEX_CMD_NAME = # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. In case there is no backslash (\) as first character +# it will be automatically added in the LaTeX code. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1721,31 +1906,33 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = {amsmath} +EXTRA_PACKAGES = -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the -# generated LaTeX document. The header should contain everything until the first -# chapter. If it is left blank doxygen will generate a standard header. See -# section "Doxygen usage" for information on how to let doxygen write the -# default header to a separate file. +# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for +# the generated LaTeX document. The header should contain everything until the +# first chapter. If it is left blank doxygen will generate a standard header. It +# is highly recommended to start with a default header using +# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty +# and then modify the file new_header.tex. See also section "Doxygen usage" for +# information on how to generate the default header that doxygen normally uses. # -# Note: Only use a user-defined header if you know what you are doing! The -# following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# Note: Only use a user-defined header if you know what you are doing! +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. The following +# commands have a special meaning inside the header (and footer): For a +# description of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the -# generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See +# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for +# the generated LaTeX document. The footer should contain everything after the +# last chapter. If it is left blank doxygen will generate a standard footer. See # LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. -# -# Note: Only use a user-defined footer if you know what you are doing! +# special commands can be used inside the footer. See also section "Doxygen +# usage" for information on how to generate the default footer that doxygen +# normally uses. Note: Only use a user-defined footer if you know what you are +# doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = @@ -1778,9 +1965,11 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a -# higher quality PDF documentation. +# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as +# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX +# files. Set this option to YES, to get a higher quality PDF documentation. +# +# See also section LATEX_CMD_NAME for selecting the engine. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1788,8 +1977,7 @@ USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode # command to the generated LaTeX files. This will instruct LaTeX to keep running -# if errors occur, instead of asking the user for help. This option is also used -# when generating formulas in HTML. +# if errors occur, instead of asking the user for help. # The default value is: NO. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1802,19 +1990,9 @@ LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO -# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source -# code with syntax highlighting in the LaTeX output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_SOURCE_CODE = NO - # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1828,6 +2006,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1867,9 +2053,9 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. @@ -1878,22 +2064,12 @@ RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- @@ -1965,6 +2141,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1983,23 +2166,14 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2059,7 +2233,7 @@ ENABLE_PREPROCESSING = YES # The default value is: NO. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -MACRO_EXPANSION = NO +MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then # the macro expansion is limited to the macros specified with the PREDEFINED and @@ -2078,7 +2252,8 @@ SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by the -# preprocessor. +# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of +# RECURSIVE has no effect here. # This tag requires that the tag SEARCH_INCLUDES is set to YES. INCLUDE_PATH = @@ -2166,34 +2341,10 @@ EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of 'which perl'). -# The default file (with absolute path) is: /usr/bin/perl. - -PERL_PATH = /usr/bin/perl - #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram -# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to -# NO turns the diagrams off. Note that this option also works with HAVE_DOT -# disabled, but it is recommended to install and use dot, since it yields more -# powerful graphs. -# The default value is: YES. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see: -# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. @@ -2226,35 +2377,50 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen -# generates you can specify the font name using DOT_FONTNAME. You need to make -# sure dot is able to find the font, which can be done by putting it in a -# standard location or by setting the DOTFONTPATH environment variable or by -# setting DOT_FONTPATH to the directory containing the font. -# The default value is: Helvetica. +# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of +# subgraphs. When you want a differently looking font in the dot files that +# doxygen generates you can specify fontname, fontcolor and fontsize attributes. +# For details please see Node, +# Edge and Graph Attributes specification You need to make sure dot is able +# to find the font, which can be done by putting it in a standard location or by +# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. Default graphviz fontsize is 14. +# The default value is: fontname=Helvetica,fontsize=10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10" + +# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can +# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about +# arrows shapes. +# The default value is: labelfontname=Helvetica,labelfontsize=10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10" -# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of -# dot graphs. -# Minimum value: 4, maximum value: 24, default value: 10. +# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes +# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification +# The default value is: shape=box,height=0.2,width=0.4. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4" -# By default doxygen will tell dot to use the default font as specified with -# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set -# the path where dot can find it using this tag. +# You can set the path where dot can find font specified with fontname in +# DOT_COMMON_ATTR and others dot attributes. # This tag requires that the tag HAVE_DOT is set to YES. DOT_FONTPATH = -# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for -# each documented class showing the direct and indirect inheritance relations. -# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a +# graph for each documented class showing the direct and indirect inheritance +# relations. In case HAVE_DOT is set as well dot will be used to draw the graph, +# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set +# to TEXT the direct and indirect inheritance relations will be shown as texts / +# links. +# Possible values are: NO, YES, TEXT and GRAPH. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. CLASS_GRAPH = YES @@ -2268,7 +2434,8 @@ CLASS_GRAPH = YES COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for -# groups, showing the direct groups dependencies. +# groups, showing the direct groups dependencies. See also the chapter Grouping +# in the manual. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2291,10 +2458,32 @@ UML_LOOK = NO # but if the number exceeds 15, the total amount of fields shown is limited to # 10. # Minimum value: 0, maximum value: 100, default value: 10. -# This tag requires that the tag HAVE_DOT is set to YES. +# This tag requires that the tag UML_LOOK is set to YES. UML_LIMIT_NUM_FIELDS = 10 +# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and +# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS +# tag is set to YES, doxygen will add type and arguments for attributes and +# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen +# will not generate fields with class member information in the UML graphs. The +# class diagrams will look similar to the default class diagrams but using UML +# notation for the relationships. +# Possible values are: NO, YES and NONE. +# The default value is: NO. +# This tag requires that the tag UML_LOOK is set to YES. + +DOT_UML_DETAILS = NO + +# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters +# to display on a single line. If the actual line length exceeds this threshold +# significantly it will wrapped across multiple lines. Some heuristics are apply +# to avoid ugly line breaks. +# Minimum value: 0, maximum value: 1000, default value: 17. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_WRAP_THRESHOLD = 17 + # If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and # collaboration graphs will show the relations between templates and their # instances. @@ -2361,6 +2550,13 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES +# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels +# of child directories generated in directory dependency graphs by dot. +# Minimum value: 1, maximum value: 25, default value: 1. +# This tag requires that the tag DIRECTORY_GRAPH is set to YES. + +DIR_GRAPH_MAX_DEPTH = 1 + # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. For an explanation of the image formats see the section # output formats in the documentation of the dot tool (Graphviz (see: @@ -2414,13 +2610,18 @@ MSCFILE_DIRS = DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. +# path where java can find the plantuml.jar file or to the filename of jar file +# to be used. If left blank, it is assumed PlantUML is not used or called during +# a preprocessing step. Doxygen will generate a warning when it encounters a +# \startuml command in this case and will not generate output for the diagram. PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. @@ -2450,18 +2651,6 @@ DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not seem -# to support this out of the box. -# -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). -# The default value is: NO. -# This tag requires that the tag HAVE_DOT is set to YES. - -DOT_TRANSPARENT = NO - # Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support @@ -2474,14 +2663,18 @@ DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page # explaining the meaning of the various boxes and arrows in the dot generated # graphs. +# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal +# graphical representation for inheritance and collaboration diagrams is used. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate # files that are used to generate the various graphs. +# +# Note: This setting is not only used for dot files but also for msc temporary +# files. # The default value is: YES. -# This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 index e834e30df..6c58cc9be 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_ESMF_Extensions.F90 @@ -33,6 +33,7 @@ !========================================================================================= ! LIS ESMF Extensions Module !========================================================================================= +!> @file LIS_ESMF_Extensions.F90 Custom ESMF extensions module LIS_ESMF_Extensions use ESMF @@ -74,6 +75,7 @@ module LIS_ESMF_Extensions ! !============================================================================== +!> @cond IGNORE_INTERFACES interface LIS_ESMF_GridWrite module procedure LIS_ESMF_GridWrite_coords module procedure LIS_ESMF_GridWrite_preset @@ -133,6 +135,7 @@ module LIS_ESMF_Extensions module procedure LIS_ESMF_LogFarrayLclVal_R82D module procedure LIS_ESMF_LogFarrayLclVal_R83D end interface +!> @endcond !============================================================================== ! diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 index c6ec09fc5..356aa7a3a 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 @@ -7,231 +7,11 @@ ! Administrator of the National Aeronautics and Space Administration. ! All Rights Reserved. !-------------------------END NOTICE -- DO NOT EDIT----------------------- -!> -!! @mainpage NASA's Land Information System (LIS) NUOPC Cap -!! @author Daniel Rosen (daniel.rosen@noaa.gov) -!! @author ESMF Support (esmf_support@ucar.edu) -!! @date 03/14/2017 LIS NUOPC Cap Added to GitHub -!! @date 03/15/2017 Documentation Added -!! -!! @tableofcontents -!! -!! @section Overview Overview -!! -!! The Land Information System (LIS) is a surface model wrapper developed -!! and maintained by the National Aeronautics and Space Administration (NASA). -!! LIS abstracts several land and ocean surface models with standard -!! interfaces. The LIS cap wraps LIS with NUOPC compliant interfaces. The -!! result is configurable surface model capable of coupling with other models -!! in the National Unified Operational Prediction Capability (NUOPC). As of -!! LIS version 7.1 only Noah v.3.3 has two-way NUOPC coupling capabilities. -!! -!! This page documents the technical design of the specialized NUOPC model and -!! the LIS gluecode. For generic NUOPC model documentation please see the -!! [NUOPC Reference Manual] (https://www.earthsystemcog.org/projects/nuopc/refmans). -!! -!! -!! @section NuopcSpecialization NUOPC Model Specialized Entry Points -!! -!! This cap specializes the cap configuration, initialization, advertised -!! fields, realized fields, data initialization, clock, run, and finalize. -!! -!! @subsection SetServices Set Services (Register Subroutines) -!! -!! Table summarizing the NUOPC specialized subroutines registered during -!! [SetServices] (@ref LIS_NUOPC::SetServices). The "Phase" column says -!! whether the subroutine is called during the initialization, run, or -!! finalize part of the coupled system run. -!! -!! Phase | Cap Subroutine | Description -!! -------|---------------------------------------------------|------------------------------------------------------------- -!! Init | [InitializeP0] (@ref LIS_NUOPC::InitializeP0) | Set the Initialize Phase Definition (IPD). Configure model -!! Init | [InitializeP1] (@ref LIS_NUOPC::InitializeP1) | Initialize model. Advertize import and export fields -!! Init | [InitializeP3] (@ref LIS_NUOPC::InitializeP3) | Realize import and export fields -!! Init | [DataInitialize] (@ref LIS_NUOPC::DataInitialize) | Initialize import and export data -!! Init | [SetClock] (@ref LIS_NUOPC::SetClock) | Set model clock during initialization -!! Run | [CheckImport] (@ref LIS_NUOPC::CheckImport) | Check timestamp on import data. -!! Run | [ModelAdvance] (@ref LIS_NUOPC::ModelAdvance) | Advances the model by a timestep -!! Final | [ModelFinalize] (@ref LIS_NUOPC::ModelFinalize) | Releases memory -!! -!! -!! @section Initialize Initialize -!! -!! Description of the initialization phases and internal model calls. -!! - [InitializeP0] (@ref LIS_NUOPC::InitializeP0) -!! - [InitializeP1] (@ref LIS_NUOPC::InitializeP1) -!! - [InitializeP3] (@ref LIS_NUOPC::InitializeP3) -!! - [DataInitialize] (@ref LIS_NUOPC::DataInitialize) -!! - [SetClock] (@ref LIS_NUOPC::SetClock) -!! -!! @subsection InitializeP0 InitializeP0 -!! -!! During initialize phase 0 the runtime configuration is read in from model -!! attributes and the initialization phase definition version is set to -!! IPDv03. -!! -!! @subsection InitializeP1 InitializeP1 -!! -!! During initialize phase 1 the model is initialized and the import and -!! export fields are advertised in nested import and export states. Import -!! fields are configured in the forcing variables list file. -!! -!! @subsection InitializeP3 InitializeP3 -!! -!! During initialize phase 3 import and export fields are realized in each -!! nested import and export state if they are connected through NUOPC. -!! Realized fields are created on the LIS grid. All export fields are realized -!! if realize all export fields is turned on. -!! -!! @subsection DataInitialize DataInitialize -!! -!! During data initialize this cap checks the timestamp of all import fields -!! dependent on a coupled model. Once all dependent import fields have been -!! initialized this cap is marked initalized. The export fields are updated -!! and initialized regardless of the import field dependencies. -!! -!! @subsection SetClock SetClock -!! -!! During set clock the cap creates a new clock for each nest. The time step -!! for each nest is set in LIS configuration file and initialized during LIS -!! initialization. The time accumulation tracker for each timestep is reset to -!! zero. The cap's time step is updated to the shortest time step -!! of all nests. The restart write time step is also created and the restart -!! write time accumulation tracker is reset to zero. -!! -!! -!! @section Run Run -!! -!! Description of the run phase(s) and internal model calls. -!! - [CheckImport] (@ref LIS_NUOPC::CheckImport) -!! - [ModelAdvance] (@ref LIS_NUOPC::ModelAdvance) -!! -!! @subsection CheckImport CheckImport -!! -!! During check import the import data is checked to verify that it is at -!! the beginning or end of the timestep. -!! -!! @subsection ModelAdvance ModelAdvance -!! -!! During model advance each nest time accumulation tracker is increased by -!! the timestep of the cap. If the time accumlation tracker is greater than -!! the time step of the nest then the nest is advanced. -!! -!! -!! @section Finalize Finalize -!! -!! Description of the finalize phase and internal model calls. -!! - [ModelFinalize] (@ref LIS_NUOPC::ModelFinalize) -!! -!! @subsection ModelFinalize ModelFinalize -!! -!! During model finalize LIS finalize subroutines are called and memory -!! allocated during cap initialization is released. -!! -!! -!! @subsection ModelConfiguration Model Configuration -!! -!! Model attributes are used to configure the model. -!! -!! Attribute | Default | Description -!! -------------------|----------------|------------------------------------------------------------------------------------- -!! Verbosity | 0 | String, converted into an integer. Bit 16: LIS cap information will be logged. -!! Diagnostic | 0 | String, converted into an integer. Bit 16: LIS cap diagnostics will be written. -!! realize_all_export | false | Realize all export fields including non connected fields. -!! config_file | lis.config | Set the LIS configuration file. -!! nest_to_nest | false | Turn on nest to nest coupling. Each nest will be identified with an integer. -!! coupled_ensemble | false | Couple ensemble members using 3D fields with ungridded dimension. -!! import_dependency | false | Data initialization will loop until all import field dependencies are satisfied. -!! output_directory | [CNAME]_OUTPUT | Configure the LIS Cap output directory. -!! -!! -!! @section ModelFields Model Fields -!! -!! The following tables list the import and export fields. -!! -!! @subsection ImportFields Import Fields -!! -!! Import fields arelisted in the import_list parameter. -!! -!! Standard Name | Units | Model Variable | Description | Notes -!! ---------------|--------|-----------------|--------------------------------------------|-------------------------------------- -!! dummy_field_1 | Pa | forcing_1 | field description for first import field | | -!! dummy_field_2 | kg | forcing_2 | field description for second import field | | -!! dummy_field_3 | W m-2 | forcing_3 | field description for third import field | field notes -!! -!! @subsection ExportField Export Fields -!! -!! Export fields are listed in the export_list parameter. -!! -!! Standard Name | Units | Model Variable | Description | Notes -!! ---------------|---------|-----------------|-------------------------------------------|--------------------------- -!! dummy_field_1 | m | output_1 | field description for first export field | field notes -!! dummy_field_2 | kg | output_2 | field description for second export field | | -!! dummy_field_3 | m s-1 | output_3 | field description for third export field | field notes -!! -!! -!! @section MemoryManagement Memory Management -!! -!! Model configuration is stored in a custom internal state data type. A -!! pointer to the custom internal state data type is stored in the component. -!! -!! The cap allocates new memory for each field so that 2-D coordinate points -!! can be translated into the LIS tiled field points. -!! -!! @section IO Input and Output -!! -!! Cap diagnostic output is written to the ESMF PET Logs. Cap diagnostic -!! output can be increased or decreased by setting the Verbosity attribute. -!! -!! NUOPC state restart write files are written depending on the -!! RestartInterval attribute. If set to 0 then NUOPC state restart write files -!! will never be written. -!! -!! LIS diagnostics output is written to the LIS logs configured in the LIS -!! configuration file. -!! -!! LIS output files are written to the output directory configured in the LIS -!! configuration file. LIS output includes LIS history files and LIS restart -!! files. -!! -!! @section BuildingAndInstalling Building and Installing -!! -!! Environment Variables -!! - ESMFMKFILE -!! -!! NUOPC Makefile Targets -!! - nuopc -!! - nuopcinstall -!! - nuopcclean -!! -!! The build system in [Makefile] (@ref Makefile) wraps the LIS build system -!! and adds the nuopc, nuopcinstall, and nuopcclean targets. Before building -!! make sure to configure the internal model. -!! -!! To build and install into the current directory run: -!! $ make nuopc -!! -!! To install into an alternative directory run: -!! $ make nuopcinstall DESTDIR= INSTDIR= -!! -!! To build with debugging information run: -!! $ make nuopc DEBUG=on -!! -!! @section Repository -!! The LIS NUOPC cap is maintained in a GitHub repository: -!! https://github.com/NESII/lis_cap -!! -!! @section References -!! -!! - [LIS] (https://modelingguru.nasa.gov/community/atmospheric/lis) -!! - [ESPS] (https://www.earthsystemcog.org/projects/esps) -!! - [ESMF] (https://www.earthsystemcog.org/projects/esmf) -!! - [NUOPC] (https://www.earthsystemcog.org/projects/nuopc/) - #define FILENAME "LIS_NUOPC_Cap.F90" #define MODNAME "LIS_NUOPC_Cap" #include "LIS_NUOPC_Macros.h" +!> @file LIS_NUOPC_Cap.F90 LIS NUOPC Cap interfaces module LIS_NUOPC use ESMF @@ -244,6 +24,7 @@ module LIS_NUOPC model_label_Advance => label_Advance, & model_label_Finalize => label_Finalize use LIS_NUOPC_Gluecode + use LIS_NUOPC_Flags use LIS_ESMF_Extensions implicit none @@ -255,12 +36,15 @@ module LIS_NUOPC CHARACTER(LEN=*), PARAMETER :: label_InternalState = 'InternalState' INTEGER, PARAMETER :: MAXNEST = 999999999 +!> @brief Custom LIS NUOPC cap internal state type type_InternalStateStruct character(len=64) :: configFile = 'lis.config' logical :: realizeAllExport = .FALSE. logical :: nestToNest = .FALSE. logical :: cplEns = .FALSE. - logical :: importDependency = .FALSE. + type(field_init_flag) :: init_export = FLD_INIT_FILLV + type(field_init_flag) :: init_import = FLD_INIT_FILLV + type(missingval_flag) :: misg_import = MISSINGVAL_FAIL character(len=40) :: dirOutput = "." integer :: nnests = 0 integer :: nfields = size(LIS_FieldList) @@ -273,9 +57,11 @@ module LIS_NUOPC integer,allocatable :: modes(:) end type +!> @cond IGNORE_WRAPPERS type type_InternalState type(type_InternalStateStruct), pointer :: wrap end type +!> @endcond !EOP @@ -283,6 +69,10 @@ module LIS_NUOPC contains !----------------------------------------------------------------------------- +!> @brief Register NUOPC compatible phases for initialize, run, and finalize +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details subroutine SetServices(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc @@ -342,6 +132,16 @@ subroutine SetServices(gcomp, rc) !----------------------------------------------------------------------------- +!> @brief Set the Initialize Phase Definition (IPD). Read model configuration +!! @param [inout] gcomp This component object +!! @param [inout] importState The coupled import state +!! @param [inout] exportState The coupled export state +!! @param [inout] clock The clock used for coupling +!! @param [out] rc Return value for subroutine +!! @details +!! During initialize phase 0 the runtime configuration is read in from model +!! attributes and the initialization phase definition version is set to +!! IPDv03. subroutine InitializeP0(gcomp, importState, exportState, clock, rc) type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState, exportState @@ -398,6 +198,9 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) contains ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +!> @brief Read configuration from component's attributes +!! @param [out] rc Return value for subroutine +!! @details subroutine LIS_AttributeGet(rc) integer, intent(out) :: rc @@ -428,6 +231,7 @@ subroutine LIS_AttributeGet(rc) call ESMF_AttributeGet(gcomp, name="realize_all_export", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return + value = ESMF_UtilStringLowerCase(value, rc=rc) is%wrap%realizeAllExport = (trim(value)=="true") ! Set configuration file name @@ -440,20 +244,44 @@ subroutine LIS_AttributeGet(rc) call ESMF_AttributeGet(gcomp, name="nest_to_nest", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return + value = ESMF_UtilStringLowerCase(value, rc=rc) is%wrap%nestToNest = (trim(value)=="true") ! Turn on ensemble coupling call ESMF_AttributeGet(gcomp, name="coupled_ensemble", value=value, & defaultValue="false", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return + value = ESMF_UtilStringLowerCase(value, rc=rc) is%wrap%cplEns = (trim(value)=="true") - ! Realize all export fields + ! export data initialization type + call ESMF_AttributeGet(gcomp, name="initialize_export", & + value=value, defaultValue="FLD_INIT_MODEL", & + convention="NUOPC", purpose="Instance", rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + is%wrap%init_export = value + + ! Initialize import setting + call ESMF_AttributeGet(gcomp, name="initialize_import", & + value=value, defaultValue="FLD_INIT_FILLV", & + convention="NUOPC", purpose="Instance", rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + is%wrap%init_import = value + + ! Import dependency call ESMF_AttributeGet(gcomp, name="import_dependency", & value=value, defaultValue="false", & convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return - is%wrap%importDependency = (trim(value)=="true") + value = ESMF_UtilStringLowerCase(value, rc=rc) + if (trim(value)=="true") is%wrap%init_import = FLD_INIT_IMPORT + + ! Missing import value option + call ESMF_AttributeGet(gcomp, name="missing_import", & + value=value, defaultValue="MISSINGVAL_FAIL", & + convention="NUOPC", purpose="Instance", rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + is%wrap%misg_import = value ! Get component output directory call ESMF_AttributeGet(gcomp, name="output_directory", & @@ -476,8 +304,17 @@ subroutine LIS_AttributeGet(rc) write (logMsg, "(A,(A,L1))") trim(cname)//': ', & 'Coupled Ensemble = ',is%wrap%cplEns call ESMF_LogWrite(trim(logMsg),ESMF_LOGMSG_INFO) - write (logMsg, "(A,(A,L1))") trim(cname)//': ', & - 'Import Dependency = ',is%wrap%importDependency + value = is%wrap%init_export + write (logMsg, "(A,(A,A))") trim(cname)//': ', & + 'Initialize Export = ',trim(value) + call ESMF_LogWrite(trim(logMsg),ESMF_LOGMSG_INFO) + value = is%wrap%init_import + write (logMsg, "(A,(A,A))") trim(cname)//': ', & + 'Initialize Import = ',trim(value) + call ESMF_LogWrite(trim(logMsg),ESMF_LOGMSG_INFO) + value = is%wrap%misg_import + write (logMsg, "(A,(A,A))") trim(cname)//': ', & + 'Missing Imports = ',trim(value) call ESMF_LogWrite(trim(logMsg),ESMF_LOGMSG_INFO) write (logMsg, "(A,(A,L1))") trim(cname)//': ', & 'Realze All Exports = ',is%wrap%realizeAllExport @@ -496,6 +333,16 @@ subroutine LIS_AttributeGet(rc) !----------------------------------------------------------------------------- +!> @brief Initialize internal model. Advertise import and export fields +!! @param [inout] gcomp This component object +!! @param [inout] importState The coupled import state +!! @param [inout] exportState The coupled export state +!! @param [inout] clock The clock used for coupling +!! @param [out] rc Return value for subroutine +!! @details +!! During initialize phase 1 the model is initialized and the import and +!! export fields are advertised in nested import and export states. Import +!! fields are configured in the forcing variables list file. subroutine InitializeP1(gcomp, importState, exportState, clock, rc) type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState, exportState @@ -651,6 +498,8 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) contains ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +!> @brief Log advertised import and export fields +!! @details subroutine LogAdvertised() ! local variables integer :: cntImp @@ -706,6 +555,17 @@ subroutine LogAdvertised() !----------------------------------------------------------------------------- +!> @brief Realize import and export fields +!! @param [inout] gcomp This component object +!! @param [inout] importState The coupled import state +!! @param [inout] exportState The coupled export state +!! @param [inout] clock The clock used for coupling +!! @param [out] rc Return value for subroutine +!! @details +!! During initialize phase 3 import and export fields are realized in each +!! nested import and export state if they are connected through NUOPC. +!! Realized fields are created on the LIS grid. All export fields are realized +!! if realize all export fields is turned on. subroutine InitializeP3(gcomp, importState, exportState, clock, rc) type(ESMF_GridComp) :: gcomp type(ESMF_State) :: importState, exportState @@ -809,9 +669,6 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) if (ESMF_STDERRORCHECK(rc)) return endif - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -841,9 +698,6 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) if (ESMF_STDERRORCHECK(rc)) return endif - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -857,9 +711,6 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) if(ESMF_STDERRORCHECK(rc)) return endif - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateImp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedImport = .TRUE. @@ -874,9 +725,6 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) if (ESMF_STDERRORCHECK(rc)) return endif - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateExp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedExport = .TRUE. @@ -894,9 +742,6 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) grid=is%wrap%grids(nIndex), typekind=ESMF_TYPEKIND_FIELD, rc=rc) if (ESMF_STDERRORCHECK(rc)) return endif - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=REAL(MISSINGVALUE,ESMF_KIND_R8), rc=rc) - if (ESMF_STDERRORCHECK(rc)) return call NUOPC_Realize(is%wrap%NStateImp(nIndex), field=field,rc=rc) if (ESMF_STDERRORCHECK(rc)) return LIS_FieldList(fIndex)%realizedImport = .TRUE. @@ -913,10 +758,17 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) endif enddo - call LIS_ESMF_FillState(is%wrap%NStateImp(nIndex),value=MISSINGVALUE,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - call LIS_ESMF_FillState(is%wrap%NStateExp(nIndex),value=MISSINGVALUE,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return + if(.not.(is%wrap%init_import .eq. FLD_INIT_MODEL)) then + call LIS_ESMF_FillState(is%wrap%NStateImp(nIndex), MISSINGVALUE, & + rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + endif + + if(.not.(is%wrap%init_export .eq. FLD_INIT_MODEL)) then + call LIS_ESMF_FillState(is%wrap%NStateExp(nIndex), MISSINGVALUE, & + rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + endif is%wrap%modes(nIndex) = LIS_RunModeGet(LIS_FieldList,is%wrap%NStateImp(nIndex),rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -927,6 +779,8 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) contains ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +!> @brief Log realized import and export fields +!! @details subroutine LogRealized() ! local variables integer :: cntImp @@ -982,6 +836,14 @@ subroutine LogRealized() !----------------------------------------------------------------------------- +!> @brief Initialize import and export data +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details +!! During data initialize this cap checks the timestamp of all import fields +!! dependent on a coupled model. Once all dependent import fields have been +!! initialized this cap is marked initalized. The export fields are updated +!! and initialized regardless of the import field dependencies. subroutine DataInitialize(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc @@ -1002,7 +864,8 @@ subroutine DataInitialize(gcomp, rc) integer :: itemCount character(len=64),allocatable :: itemNameList(:) type(ESMF_StateItem_Flag), allocatable :: itemTypeList(:) - type(ESMF_Field) :: field + type(ESMF_Field) :: ifield, efield + integer :: eSearch logical :: importCurrent logical :: importUpdated @@ -1045,7 +908,41 @@ subroutine DataInitialize(gcomp, rc) do nIndex=1,is%wrap%nnests write (nStr,"(I0)") nIndex - if (is%wrap%importDependency) then + ! Initialize export fields + call LIS_NUOPC_DataInit(nest=nIndex, & + exportState=is%wrap%NStateExp(nIndex),rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemCount=itemCount, rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + allocate( & + itemNameList(itemCount), & + itemTypeList(itemCount), & + stat=stat) + if (ESMF_LogFoundAllocError(statusToCheck=stat, & + msg="Allocation of state item list memory failed.", & + line=__LINE__, & + file=__FILE__)) & + return + call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemNameList=itemNameList, & + itemTypeList=itemTypeList,rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + do iIndex=1, itemCount + if (itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then + call ESMF_StateGet(is%wrap%NStateExp(nIndex),field=efield, & + itemName=itemNameList(iIndex),rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + call NUOPC_SetAttribute(efield, name="Updated", value="true", rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + endif + enddo + deallocate(itemNameList, itemTypeList, stat=stat) + if (ESMF_LogFoundDeallocError(statusToCheck=stat, & + msg="Deallocation of state item list memory failed.", & + line=__LINE__, & + file=__FILE__)) & + return + + if (is%wrap%init_import .eq. FLD_INIT_IMPORT) then ! Check data dependencies importCurrent = NUOPC_IsAtTime(is%wrap%NStateImp(nIndex), & time=currTime, rc=rc) @@ -1055,7 +952,7 @@ subroutine DataInitialize(gcomp, rc) call ESMF_LogWrite( & trim(cname)//': '//rname//' Initialize-Data-Dependency SATISFIED!!! Nest='//trim(nStr), & ESMF_LOGMSG_INFO) - call LIS_ImportFieldsCopy(nIndex,is%wrap%NStateImp(nIndex),rc=rc) + call LIS_ImportFieldsCopy(nIndex,is%wrap%NStateImp(nIndex),is%wrap%misg_import,rc=rc) if (ESMF_STDERRORCHECK(rc)) return else call ESMF_LogWrite( & @@ -1064,7 +961,7 @@ subroutine DataInitialize(gcomp, rc) importUpdated = .FALSE. endif else - ! Reset all import fields to zero + ! Reset all import fields to export or fillv call ESMF_StateGet(is%wrap%NStateImp(nIndex),itemCount=itemCount, rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1084,12 +981,33 @@ subroutine DataInitialize(gcomp, rc) do iIndex=1, itemCount if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then - call ESMF_StateGet(is%wrap%NStateImp(nIndex),field=field, & + call ESMF_StateGet(is%wrap%NStateImp(nIndex),field=ifield, & itemName=itemNameList(iIndex),rc=rc) if (ESMF_STDERRORCHECK(rc)) return - call ESMF_FieldFill(field, dataFillScheme="const", & - const1=0.0D0, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return + call ESMF_StateGet(is%wrap%NStateExp(nIndex), & + itemSearch=itemNameList(iIndex), itemCount=eSearch, rc=rc) + if (eSearch .gt. 0) then + call ESMF_StateGet(is%wrap%NStateExp(nIndex),field=efield, & + itemName=itemNameList(iIndex),rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + call ESMF_FieldCopy(ifield, fieldIn=efield, rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + else + if (is%wrap%init_import .eq. FLD_INIT_ZERO) then + call ESMF_FieldFill(ifield, dataFillScheme="const", & + const1=0.0_ESMF_KIND_R8, rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + elseif (is%wrap%init_import .eq. FLD_INIT_FILLV) then + call ESMF_FieldFill(ifield, dataFillScheme="const", & + const1=MISSINGVALUE, rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + else + call ESMF_LogSetError(ESMF_FAILURE, & + msg="Invalid import initialization option.", & + line=__LINE__,file=__FILE__,rcToReturn=rc) + return + endif + endif endif enddo @@ -1101,45 +1019,23 @@ subroutine DataInitialize(gcomp, rc) return endif - ! Initialize import and export fields - call LIS_NUOPC_DataInit(nest=nIndex, & - importState=is%wrap%NStateImp(nIndex), & - exportState=is%wrap%NStateExp(nIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - - call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemCount=itemCount, rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - - allocate( & - itemNameList(itemCount), & - itemTypeList(itemCount), & - stat=stat) - if (ESMF_LogFoundAllocError(statusToCheck=stat, & - msg="Allocation of state item list memory failed.", & - line=__LINE__, & - file=__FILE__)) & + if(is%wrap%init_export .eq. FLD_INIT_FILLV) then + call LIS_ESMF_FillState(is%wrap%NStateExp(nIndex), MISSINGVALUE, & + rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + elseif(is%wrap%init_export .eq. FLD_INIT_ZERO) then + call LIS_ESMF_FillState(is%wrap%NStateExp(nIndex), 0.0_ESMF_KIND_R8, & + rc=rc) + if (ESMF_STDERRORCHECK(rc)) return + elseif(is%wrap%init_export .eq. FLD_INIT_MODEL) then + ! do nothing + else + call ESMF_LogSetError(ESMF_FAILURE, & + msg="Invalid export initialization option.", & + line=__LINE__,file=__FILE__,rcToReturn=rc) return + endif - call ESMF_StateGet(is%wrap%NStateExp(nIndex),itemNameList=itemNameList, & - itemTypeList=itemTypeList,rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - - do iIndex=1, itemCount - if ( itemTypeList(iIndex) == ESMF_STATEITEM_FIELD) then - call ESMF_StateGet(is%wrap%NStateExp(nIndex),field=field, & - itemName=itemNameList(iIndex),rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - call NUOPC_SetAttribute(field, name="Updated", value="true", rc=rc) - if (ESMF_STDERRORCHECK(rc)) return - endif - enddo - - deallocate(itemNameList, itemTypeList, stat=stat) - if (ESMF_LogFoundDeallocError(statusToCheck=stat, & - msg="Deallocation of state item list memory failed.", & - line=__LINE__, & - file=__FILE__)) & - return enddo ! enddo nnests ! set InitializeDataComplete Attribute to "true", indicating to the @@ -1169,6 +1065,16 @@ subroutine DataInitialize(gcomp, rc) !----------------------------------------------------------------------------- +!> @brief Set model clock during initialization +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details +!! During set clock the cap creates a new clock for each nest. The time step +!! for each nest is set in LIS configuration file and initialized during LIS +!! initialization. The time accumulation tracker for each timestep is reset to +!! zero. The cap's time step is updated to the shortest time step +!! of all nests. The restart write time step is also created and the restart +!! write time accumulation tracker is reset to zero. subroutine SetClock(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc @@ -1248,7 +1154,13 @@ subroutine SetClock(gcomp, rc) !----------------------------------------------------------------------------- -subroutine CheckImport(gcomp, rc) +!> @brief Check timestamp on import data +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details +!! During check import the import data is checked to verify that it is at +!! the beginning or end of the timestep. + subroutine CheckImport(gcomp, rc) type(ESMF_GridComp) :: gcomp integer,intent(out) :: rc @@ -1318,6 +1230,13 @@ subroutine CheckImport(gcomp, rc) !----------------------------------------------------------------------------- +!> @brief Advances the model by a timestep +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details +!! During model advance each nest time accumulation tracker is increased by +!! the timestep of the cap. If the time accumlation tracker is greater than +!! the time step of the nest then the nest is advanced. subroutine ModelAdvance(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc @@ -1412,7 +1331,7 @@ subroutine ModelAdvance(gcomp, rc) endif call LIS_NUOPC_Run(nIndex,is%wrap%modes(nIndex), & is%wrap%NStateImp(nIndex),is%wrap%NStateExp(nIndex), & - is%wrap%clocks(nIndex), rc=rc) + is%wrap%clocks(nIndex), is%wrap%misg_import, rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_ClockAdvance(is%wrap%clocks(nIndex),rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1432,6 +1351,9 @@ subroutine ModelAdvance(gcomp, rc) contains ! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +!> @brief Log model advance call +!! @param [inout] nIndex Index of nest +!! @details subroutine LogAdvance(nIndex) integer :: nIndex ! local variables @@ -1499,6 +1421,12 @@ subroutine LogAdvance(nIndex) !----------------------------------------------------------------------------- +!> @brief Releases memory +!! @param [inout] gcomp This component object +!! @param [out] rc Return value for subroutine +!! @details +!! During model finalize LIS finalize subroutines are called and memory +!! allocated during cap initialization is released. see ::modelfinalize subroutine ModelFinalize(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 index 0037026cf..65ae1b0b5 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_DataCopy.F90 @@ -11,6 +11,7 @@ #define MODNAME "lis_nuopc_datacopy" #include "LIS_NUOPC_Macros.h" +!> @file LIS_NUOPC_DataCopy.F90 LIS NUOPC Cap data copy interfaces module LIS_NUOPC_DataCopy !BOP ! @@ -25,6 +26,7 @@ module LIS_NUOPC_DataCopy ! !USES: use ESMF use NUOPC + use LIS_NUOPC_Flags use LIS_coreMod, only: & LIS_rc, & LIS_domain @@ -48,6 +50,7 @@ module LIS_NUOPC_DataCopy ! Interface definitions for copy from LIS 1D tiled data to 2D !----------------------------------------------------------------------------- +!> @cond IGNORE_INTERFACES interface LIS_CopyToLIS module procedure LIS_FieldCopyToLisField module procedure LIS_FieldCopyToLisFarray @@ -67,29 +70,20 @@ module LIS_NUOPC_DataCopy interface LIS_CopyToNoah_3_3 module procedure LIS_FieldCopyToNoah_3_3 - module procedure LIS_ArrayCopyToNoah_3_3 - module procedure LIS_FarrayR8CopyToNoah_3_3 - module procedure LIS_FarrayR4CopyToNoah_3_3 - module procedure LIS_EnsFarrayR4CopyToNoah_3_3 - module procedure LIS_EnsFarrayR8CopyToNoah_3_3 + module procedure LIS_FarrayCopyToNoah_3_3 + module procedure LIS_EnsFarrayCopyToNoah_3_3 end interface interface LIS_CopyToNoahMP_3_6 module procedure LIS_FieldCopyToNoahMP_3_6 - module procedure LIS_ArrayCopyToNoahMP_3_6 - module procedure LIS_FarrayR8CopyToNoahMP_3_6 - module procedure LIS_FarrayR4CopyToNoahMP_3_6 - module procedure LIS_EnsFarrayR4CopyToNoahMP_3_6 - module procedure LIS_EnsFarrayR8CopyToNoahMP_3_6 + module procedure LIS_FarrayCopyToNoahMP_3_6 + module procedure LIS_EnsFarrayCopyToNoahMP_3_6 end interface interface LIS_CopyToNoahMP_4_0_1 module procedure LIS_FieldCopyToNoahMP_4_0_1 - module procedure LIS_ArrayCopyToNoahMP_4_0_1 - module procedure LIS_FarrayR8CopyToNoahMP_4_0_1 - module procedure LIS_FarrayR4CopyToNoahMP_4_0_1 - module procedure LIS_EnsFarrayR4CopyToNoahMP_4_0_1 - module procedure LIS_EnsFarrayR8CopyToNoahMP_4_0_1 + module procedure LIS_FarrayCopyToNoahMP_4_0_1 + module procedure LIS_EnsFarrayCopyToNoahMP_4_0_1 end interface interface LIS_CopyFromLIS @@ -108,6 +102,7 @@ module LIS_NUOPC_DataCopy module procedure LIS_EnsFarrayR4CopyFromLisFarrayR4 module procedure LIS_EnsFarrayR8CopyFromLisFarrayR8 end interface +!> @endcond !----------------------------------------------------------------------------- ! !LOCAL VARIABLES: @@ -166,71 +161,6 @@ subroutine LIS_FieldCopyToLisFarray(field,farrayLIS,nest,rc) !----------------------------------------------------------------------------- -#undef METHOD -#define METHOD "LIS_FieldCopyToNoah_3_3" - - subroutine LIS_FieldCopyToNoah_3_3(field,stdName,nest,rc) -! !ARGUMENTS: - type(ESMF_Field),intent(in) :: field - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !ARGUMENTS: - type(ESMF_Array) :: array - - rc = ESMF_SUCCESS - - call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoah_3_3(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - end subroutine - - !----------------------------------------------------------------------------- - -#undef METHOD -#define METHOD "LIS_FieldCopyToNoahMP_3_6" - - subroutine LIS_FieldCopyToNoahMP_3_6(field,stdName,nest,rc) -! !ARGUMENTS: - type(ESMF_Field),intent(in) :: field - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !ARGUMENTS: - type(ESMF_Array) :: array - - rc = ESMF_SUCCESS - - call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_3_6(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - end subroutine - - !----------------------------------------------------------------------------- -#undef METHOD -#define METHOD "LIS_FieldCopyToNoahMP_4_0_1" - - subroutine LIS_FieldCopyToNoahMP_4_0_1(field,stdName,nest,rc) -! !ARGUMENTS: - type(ESMF_Field),intent(in) :: field - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !ARGUMENTS: - type(ESMF_Array) :: array - - rc = ESMF_SUCCESS - - call ESMF_FieldGet(field=field,array=array,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_4_0_1(array=array,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - end subroutine - - !----------------------------------------------------------------------------- - #undef METHOD #define METHOD "LIS_FieldCopyFromLisField" @@ -413,22 +343,23 @@ subroutine LIS_ArrayCopyToLisArray(array,arrayLIS,nest,rc) !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_ArrayCopyToNoah_3_3" +#define METHOD "LIS_FieldCopyToNoah_3_3" - subroutine LIS_ArrayCopyToNoah_3_3(array,stdName,nest,rc) +!> @brief Copy ESMF field to Noah v3.3 LSM + subroutine LIS_FieldCopyToNoah_3_3(field,stdName,nest,missing,rc) ! !ARGUMENTS: - type(ESMF_Array),intent(in) :: array + type(ESMF_Field),intent(in) :: field character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: + type(ESMF_Array) :: array integer :: localDeCount type(ESMF_TypeKind_Flag) :: typekind integer :: rank - real(ESMF_KIND_R4),pointer :: farray_R4(:,:) - real(ESMF_KIND_R8),pointer :: farray_R8(:,:) - real(ESMF_KIND_R4),pointer :: farray3D_R4(:,:,:) - real(ESMF_KIND_R8),pointer :: farray3D_R8(:,:,:) + real(ESMF_KIND_FIELD),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),pointer :: farray3D(:,:,:) ! ! !DESCRIPTION: ! @@ -436,10 +367,11 @@ subroutine LIS_ArrayCopyToNoah_3_3(array,stdName,nest,rc) !EOP rc = ESMF_SUCCESS + call ESMF_FieldGet(field=field,array=array,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return call ESMF_ArrayGet(array,typekind=typekind,rank=rank, & localDeCount=localDeCount,rc=rc) if (ESMF_STDERRORCHECK(rc)) return - if (rank /= 2 .AND. rank /= 3) then call ESMF_LogSetError(ESMF_RC_ARG_OUTOFRANGE, & msg="Cannot copy. Array is not a 2D or 3D array.", & @@ -452,61 +384,40 @@ subroutine LIS_ArrayCopyToNoah_3_3(array,stdName,nest,rc) line=__LINE__, file=FILENAME, rcToReturn=rc) return endif - if(rank==2) then - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoah_3_3(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoah_3_3(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif + call ESMF_ArrayGet(array,farrayPtr=farray,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call LIS_CopyToNoah_3_3(farray=farray,stdName=stdName,nest=nest, & + missing=missing,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return else - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoah_3_3(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoah_3_3(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif + call ESMF_ArrayGet(array,farrayPtr=farray3D,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call LIS_CopyToNoah_3_3(farray=farray3D,stdName=stdName,nest=nest, & + missing=missing,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_ArrayCopyToNoahMP_3_6" +#define METHOD "LIS_FieldCopyToNoahMP_3_6" - subroutine LIS_ArrayCopyToNoahMP_3_6(array,stdName,nest,rc) + subroutine LIS_FieldCopyToNoahMP_3_6(field,stdName,nest,missing,rc) ! !ARGUMENTS: - type(ESMF_Array),intent(in) :: array + type(ESMF_Field),intent(in) :: field character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: + type(ESMF_Array) :: array integer :: localDeCount type(ESMF_TypeKind_Flag) :: typekind integer :: rank - real(ESMF_KIND_R4),pointer :: farray_R4(:,:) - real(ESMF_KIND_R8),pointer :: farray_R8(:,:) - real(ESMF_KIND_R4),pointer :: farray3D_R4(:,:,:) - real(ESMF_KIND_R8),pointer :: farray3D_R8(:,:,:) + real(ESMF_KIND_FIELD),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),pointer :: farray3D(:,:,:) ! ! !DESCRIPTION: ! @@ -514,6 +425,9 @@ subroutine LIS_ArrayCopyToNoahMP_3_6(array,stdName,nest,rc) !EOP rc = ESMF_SUCCESS + call ESMF_FieldGet(field=field,array=array,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call ESMF_ArrayGet(array,typekind=typekind,rank=rank, & localDeCount=localDeCount,rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -532,59 +446,39 @@ subroutine LIS_ArrayCopyToNoahMP_3_6(array,stdName,nest,rc) endif if(rank==2) then - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_3_6(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_3_6(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif + call ESMF_ArrayGet(array,farrayPtr=farray,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call LIS_CopyToNoahMP_3_6(farray=farray,stdName=stdName,nest=nest, & + missing=missing,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return else - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_3_6(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_3_6(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif + call ESMF_ArrayGet(array,farrayPtr=farray3D,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call LIS_CopyToNoahMP_3_6(farray=farray3D,stdName=stdName,nest=nest, & + missing=missing,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_ArrayCopyToNoahMP_4_0_1" +#define METHOD "LIS_FieldCopyToNoahMP_4_0_1" - subroutine LIS_ArrayCopyToNoahMP_4_0_1(array,stdName,nest,rc) + subroutine LIS_FieldCopyToNoahMP_4_0_1(field,stdName,nest,missing,rc) ! !ARGUMENTS: - type(ESMF_Array),intent(in) :: array + type(ESMF_Field),intent(in) :: field character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: + type(ESMF_Array) :: array integer :: localDeCount type(ESMF_TypeKind_Flag) :: typekind integer :: rank - real(ESMF_KIND_R4),pointer :: farray_R4(:,:) - real(ESMF_KIND_R8),pointer :: farray_R8(:,:) - real(ESMF_KIND_R4),pointer :: farray3D_R4(:,:,:) - real(ESMF_KIND_R8),pointer :: farray3D_R8(:,:,:) + real(ESMF_KIND_FIELD),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),pointer :: farray3D(:,:,:) ! ! !DESCRIPTION: ! @@ -592,6 +486,9 @@ subroutine LIS_ArrayCopyToNoahMP_4_0_1(array,stdName,nest,rc) !EOP rc = ESMF_SUCCESS + call ESMF_FieldGet(field=field,array=array,rc=rc) + if(ESMF_STDERRORCHECK(rc)) return + call ESMF_ArrayGet(array,typekind=typekind,rank=rank, & localDeCount=localDeCount,rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -610,37 +507,17 @@ subroutine LIS_ArrayCopyToNoahMP_4_0_1(array,stdName,nest,rc) endif if(rank==2) then - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray_R4,rc=rc) + call ESMF_ArrayGet(array,farrayPtr=farray,rc=rc) if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_4_0_1(farray=farray_R4,stdName=stdName,nest=nest,rc=rc) + call LIS_CopyToNoahMP_4_0_1(farray=farray,stdName=stdName,nest=nest, & + missing=missing, rc=rc) if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray_R8,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_4_0_1(farray=farray_R8,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif else - if(typekind==ESMF_TYPEKIND_R4) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R4,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_4_0_1(farray=farray3D_R4,stdName=stdName,nest=nest,rc=rc) - if(ESMF_STDERRORCHECK(rc)) return - elseif(typekind==ESMF_TYPEKIND_R8) then - call ESMF_ArrayGet(array,farrayPtr=farray3D_R8,rc=rc) + call ESMF_ArrayGet(array,farrayPtr=farray3D,rc=rc) if(ESMF_STDERRORCHECK(rc)) return - call LIS_CopyToNoahMP_4_0_1(farray=farray3D_R8,stdName=stdName,nest=nest,rc=rc) + call LIS_CopyToNoahMP_4_0_1(farray=farray3D,stdName=stdName,nest=nest, & + missing=missing, rc=rc) if(ESMF_STDERRORCHECK(rc)) return - else - call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & - msg="Typekind copy not implemented.",rcToReturn=rc) - return - endif endif end subroutine @@ -1079,13 +956,14 @@ subroutine LIS_FarrayR8CopyToLisFarrayR8(farray,farrayLIS,nest,rc) !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_FarrayR4CopyToNoah_3_3" +#define METHOD "LIS_FarrayCopyToNoah_3_3" - subroutine LIS_FarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) + subroutine LIS_FarrayCopyToNoah_3_3(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row @@ -1093,85 +971,112 @@ subroutine LIS_FarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row) + endif enddo #endif case default @@ -1180,126 +1085,122 @@ subroutine LIS_FarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- - -#undef METHOD -#define METHOD "LIS_FarrayR4CopyToNoahMP_3_6" - - subroutine LIS_FarrayR4CopyToNoahMP_3_6(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row) + noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row) + noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row) + noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row) + noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row) enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row) + noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row) enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row) + noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row) enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row) + noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row) enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row) + noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row) enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row) + noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row) enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row) + noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row) enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row) + noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row) enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row) + noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row) enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row) + noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row) enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & + msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_FarrayR4CopyToNoahMP_4_0_1" +#define METHOD "LIS_FarrayCopyToNoahMP_3_6" - subroutine LIS_FarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) + subroutine LIS_FarrayCopyToNoahMP_3_6(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row @@ -1307,213 +1208,249 @@ subroutine LIS_FarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%smc(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%smc(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%smc(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%smc(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%tslb(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%tslb(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%tslb(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row) + endif + enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%wa = farray(col,row) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - Noahmp401_struc(nest)%noahmp401(tile)%sfcheadrt = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row) + endif enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & + msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- - -#undef METHOD -#define METHOD "LIS_FarrayR8CopyToNoah_3_3" - - subroutine LIS_FarrayR8CopyToNoah_3_3(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row) enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row) enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row) enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row) enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row) enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row) enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row) enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row) + enddo + case ('soil_temperature_layer_3') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row) enddo - case ('soil_temperature_layer_3') + case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row) enddo - case ('soil_temperature_layer_4') + case ('ground_water_storage') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%wa = farray(col,row) enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row) + NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row) enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to noah33 "//trim(stdName), & + msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_FarrayR8CopyToNoahMP_3_6" +#define METHOD "LIS_FarrayCopyToNoahMP_4_0_1" - subroutine LIS_FarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) + subroutine LIS_FarrayCopyToNoahMP_4_0_1(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row @@ -1521,113 +1458,138 @@ subroutine LIS_FarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(1) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(2) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(3) = farray(col,row) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(4) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(1) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(2) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(3) = farray(col,row) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(4) = farray(col,row) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(1) = farray(col,row) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(2) = farray(col,row) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(3) = farray(col,row) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row) + endif + enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%wa = farray(col,row) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row) + if (farray(col,row) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sfcheadrt = farray(col,row) + endif enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & + msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- -#undef METHOD -#define METHOD "LIS_FarrayR8CopyToNoahMP_4_0_1" - - subroutine LIS_FarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col @@ -1700,6 +1662,12 @@ subroutine LIS_FarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) row = LIS_domain(nest)%tile(tile)%row Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row) enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + Noahmp401_struc(nest)%noahmp401(tile)%wa = farray(col,row) + enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) @@ -1714,7 +1682,12 @@ subroutine LIS_FarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- @@ -2083,13 +2056,14 @@ subroutine LIS_EnsFarrayR8CopyToLisFarrayR8(farray,farrayLIS,nest,rc) !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_EnsFarrayR4CopyToNoah_3_3" +#define METHOD "LIS_EnsFarrayCopyToNoah_3_3" - subroutine LIS_EnsFarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) + subroutine LIS_EnsFarrayCopyToNoah_3_3(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row, ens @@ -2097,90 +2071,115 @@ subroutine LIS_EnsFarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row,ens) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') @@ -2188,7 +2187,9 @@ subroutine LIS_EnsFarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row,ens) + endif enddo #endif case default @@ -2197,109 +2198,99 @@ subroutine LIS_EnsFarrayR4CopyToNoah_3_3(farray,stdName,nest,rc) line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- - -#undef METHOD -#define METHOD "LIS_EnsFarrayR4CopyToNoahMP_3_6" - - subroutine LIS_EnsFarrayR4CopyToNoahMP_3_6(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row, ens -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row,ens) + ens = LIS_domain(nest)%tile(tile)%ensem + noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row,ens) enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row,ens) enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row,ens) enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row,ens) enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row,ens) enddo #ifdef WRF_HYDRO case ('surface_water_depth') @@ -2307,28 +2298,35 @@ subroutine LIS_EnsFarrayR4CopyToNoahMP_3_6(farray,stdName,nest,rc) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row,ens) + noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row,ens) enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & + msg="Cannot directly hookup to noah33 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_EnsFarrayR4CopyToNoahMP_4_0_1" +#define METHOD "LIS_EnsFarrayCopyToNoahMP_3_6" - subroutine LIS_EnsFarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) + subroutine LIS_EnsFarrayCopyToNoahMP_3_6(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R4),intent(in),pointer :: farray(:,:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row, ens @@ -2336,90 +2334,123 @@ subroutine LIS_EnsFarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%sh2o(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%smc(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%smc(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%smc(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%smc(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%tslb(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%tslb(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%tslb(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row,ens) + endif + enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + ens = LIS_domain(nest)%tile(tile)%ensem + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%wa = farray(col,row,ens) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') @@ -2427,119 +2458,116 @@ subroutine LIS_EnsFarrayR4CopyToNoahMP_4_0_1(farray,stdName,nest,rc) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - Noahmp401_struc(nest)%noahmp401(tile)%sfcheadrt = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row,ens) + endif enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & + msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- - -#undef METHOD -#define METHOD "LIS_EnsFarrayR8CopyToNoah_3_3" - - subroutine LIS_EnsFarrayR8CopyToNoah_3_3(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row, ens -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(1) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(2) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row - ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(3) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row,ens) enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sh2o(4) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(1) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(2) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(3) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row,ens) enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%smc(4) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row,ens) enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(1) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row,ens) enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(2) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row,ens) enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(3) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row,ens) enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%stc(4) = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row,ens) + enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + ens = LIS_domain(nest)%tile(tile)%ensem + NoahMP36_struc(nest)%noahmp36(tile)%wa = farray(col,row,ens) enddo #ifdef WRF_HYDRO case ('surface_water_depth') @@ -2547,28 +2575,34 @@ subroutine LIS_EnsFarrayR8CopyToNoah_3_3(farray,stdName,nest,rc) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - noah33_struc(nest)%noah(tile)%sfhead1rt = farray(col,row,ens) + NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row,ens) enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to noah33 "//trim(stdName), & + msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- #undef METHOD -#define METHOD "LIS_EnsFarrayR8CopyToNoahMP_3_6" +#define METHOD "LIS_EnsFarrayCopyToNoahMP_4_0_1" - subroutine LIS_EnsFarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) + subroutine LIS_EnsFarrayCopyToNoahMP_4_0_1(farray,stdName,nest,missing,rc) ! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:,:) + real(ESMF_KIND_FIELD),intent(in),pointer :: farray(:,:,:) character(*),intent(in) :: stdName integer,intent(in) :: nest + type(missingval_flag),intent(in) :: missing integer,intent(out) :: rc ! !LOCAL VARIABLES: integer :: tile, col, row, ens @@ -2576,90 +2610,124 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) ! This routine copies from a 2D array to an LIS 1D array !EOP rc = ESMF_SUCCESS - select case (trim(stdName)) + if (missing .eq. MISSINGVAL_SKPCPY) then + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(1) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(2) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(3) = farray(col,row,ens) + endif enddo case ('liquid_fraction_of_soil_moisture_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sh2o(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sh2o(4) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(1) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(2) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(3) = farray(col,row,ens) + endif enddo case ('soil_moisture_fraction_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%smc(4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%smc(4) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+1) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(1) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_2') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+2) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(2) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_3') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+3) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(3) = farray(col,row,ens) + endif enddo case ('soil_temperature_layer_4') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sstc(NOAHMP36_struc(nest)%nsnow+4) = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row,ens) + endif + enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + ens = LIS_domain(nest)%tile(tile)%ensem + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%wa = farray(col,row,ens) + endif enddo #ifdef WRF_HYDRO case ('surface_water_depth') @@ -2667,35 +2735,27 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_3_6(farray,stdName,nest,rc) col = LIS_domain(nest)%tile(tile)%col row = LIS_domain(nest)%tile(tile)%row ens = LIS_domain(nest)%tile(tile)%ensem - NoahMP36_struc(nest)%noahmp36(tile)%sfcheadrt = farray(col,row,ens) + if (farray(col,row,ens) .ne. real(MISSINGVALUE,ESMF_KIND_FIELD)) then + Noahmp401_struc(nest)%noahmp401(tile)%sfcheadrt = farray(col,row,ens) + endif enddo #endif case default call ESMF_LogSetError(ESMF_RC_ARG_BAD, & - msg="Cannot directly hookup to NoahMP36 "//trim(stdName), & + msg="Cannot directly hookup to Noahmp401 "//trim(stdName), & line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - - end subroutine - - !----------------------------------------------------------------------------- -#undef METHOD -#define METHOD "LIS_EnsFarrayR8CopyToNoahMP_4_0_1" - - subroutine LIS_EnsFarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) -! !ARGUMENTS: - real(ESMF_KIND_R8),intent(in),pointer :: farray(:,:,:) - character(*),intent(in) :: stdName - integer,intent(in) :: nest - integer,intent(out) :: rc -! !LOCAL VARIABLES: - integer :: tile, col, row, ens -! !DESCRIPTION: -! This routine copies from a 2D array to an LIS 1D array -!EOP - rc = ESMF_SUCCESS - select case (trim(stdName)) + elseif ((missing .eq. MISSINGVAL_IGNORE) .or. & + (missing .eq. MISSINGVAL_FAIL)) then + if ((missing .eq. MISSINGVAL_FAIL) .and. & + any(farray .eq. real(MISSINGVALUE,ESMF_KIND_FIELD))) then + call ESMF_LogSetError(ESMF_RC_VAL_OUTOFRANGE, & + msg="Invalid import data "//trim(stdName), & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif + select case (trim(stdName)) case ('liquid_fraction_of_soil_moisture_layer_1') do tile=1,LIS_rc%ntiles(nest) col = LIS_domain(nest)%tile(tile)%col @@ -2780,6 +2840,13 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) ens = LIS_domain(nest)%tile(tile)%ensem Noahmp401_struc(nest)%noahmp401(tile)%tslb(4) = farray(col,row,ens) enddo + case ('ground_water_storage') + do tile=1,LIS_rc%ntiles(nest) + col = LIS_domain(nest)%tile(tile)%col + row = LIS_domain(nest)%tile(tile)%row + ens = LIS_domain(nest)%tile(tile)%ensem + Noahmp401_struc(nest)%noahmp401(tile)%wa = farray(col,row,ens) + enddo #ifdef WRF_HYDRO case ('surface_water_depth') do tile=1,LIS_rc%ntiles(nest) @@ -2795,7 +2862,12 @@ subroutine LIS_EnsFarrayR8CopyToNoahMP_4_0_1(farray,stdName,nest,rc) line=__LINE__, file=FILENAME, rcToReturn=rc) return end select - + else + call ESMF_LogSetError(ESMF_RC_ARG_BAD, & + msg="Unknown missing value option", & + line=__LINE__, file=FILENAME, rcToReturn=rc) + return + endif end subroutine !----------------------------------------------------------------------------- diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Flags.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Flags.F90 new file mode 100644 index 000000000..45f37728b --- /dev/null +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Flags.F90 @@ -0,0 +1,211 @@ +!-----------------------BEGIN NOTICE -- DO NOT EDIT----------------------- +! NASA Goddard Space Flight Center +! Land Information System Framework (LISF) +! Version 7.3 +! +! Copyright (c) 2020 United States Government as represented by the +! Administrator of the National Aeronautics and Space Administration. +! All Rights Reserved. +!-------------------------END NOTICE -- DO NOT EDIT----------------------- +#define FILENAME "lis_nuopc_flags" +#define MODNAME "lis_nuopc_flags" +#include "LIS_NUOPC_Macros.h" + +!> @file LIS_NUOPC_Flags.F90 LIS NUOPC Cap configuration flags +module LIS_NUOPC_Flags +!BOP +! +! !MODULE: LIS_NUOPC_Flags +! +! !DESCRIPTION: +! This module contains configuration setting flags +! +! !REVISION HISTORY: +! 2022May02 Dan Rosen Added +! +! !USES: + use ESMF, only: ESMF_UtilStringUpperCase, ESMF_SUCCESS + IMPLICIT NONE + + PRIVATE + +!----------------------------------------------------------------------------- +! !FLAG TYPES AND VALUES +!----------------------------------------------------------------------------- + +!> @cond IGNORE_TYPE_FLAGS + type missingval_flag + sequence + private + integer :: opt + end type missingval_flag + + type field_init_flag + sequence + private + integer :: opt + end type field_init_flag +!> @endcond + + type(missingval_flag), parameter :: & + MISSINGVAL_ERROR = missingval_flag(-1), & + MISSINGVAL_IGNORE = missingval_flag(0), & + MISSINGVAL_FAIL = missingval_flag(1), & + MISSINGVAL_SKPCPY = missingval_flag(2) + + type(field_init_flag), parameter :: & + FLD_INIT_ERROR = field_init_flag(-1), & + FLD_INIT_ZERO = field_init_flag(0), & + FLD_INIT_MODEL = field_init_flag(1), & + FLD_INIT_FILLV = field_init_flag(2), & + FLD_INIT_IMPORT = field_init_flag(3) + +!----------------------------------------------------------------------------- +! !PUBLIC MEMBER FUNCTIONS: +!----------------------------------------------------------------------------- + + public missingval_flag + public field_init_flag + public MISSINGVAL_ERROR + public MISSINGVAL_IGNORE + public MISSINGVAL_FAIL + public MISSINGVAL_SKPCPY + public FLD_INIT_ERROR + public FLD_INIT_ZERO + public FLD_INIT_MODEL + public FLD_INIT_FILLV + public FLD_INIT_IMPORT + + public operator(==), assignment(=) + +!----------------------------------------------------------------------------- +! !INTERFACE DEFINITIONS: +!----------------------------------------------------------------------------- + +!> @cond IGNORE_INTERFACES + interface operator (==) + module procedure missingval_eq + module procedure field_init_eq + end interface + + interface assignment (=) + module procedure missingval_toString + module procedure missingval_frString + module procedure field_init_toString + module procedure field_init_frString + end interface +!> @endcond + + !----------------------------------------------------------------------------- + contains + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "missingval_eq" + function missingval_eq(val1, val2) + logical missingval_eq + type(missingval_flag), intent(in) :: val1, val2 + missingval_eq = (val1%opt == val2%opt) + end function missingval_eq + + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "missingval_toString" + subroutine missingval_toString(string, val) + character(len=*), intent(out) :: string + type(missingval_flag), intent(in) :: val + if (val == MISSINGVAL_IGNORE) then + write(string,'(a)') 'MISSINGVAL_IGNORE' + elseif (val == MISSINGVAL_FAIL) then + write(string,'(a)') 'MISSINGVAL_FAIL' + elseif (val == MISSINGVAL_SKPCPY) then + write(string,'(a)') 'MISSINGVAL_SKPCPY' + else + write(string,'(a)') 'MISSINGVAL_ERROR' + endif + end subroutine missingval_toString + + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "missingval_frString" + subroutine missingval_frString(val, string) + type(missingval_flag), intent(out) :: val + character(len=*), intent(in) :: string + character(len=32) :: ustring + integer :: rc + ustring = ESMF_UtilStringUpperCase(string, rc=rc) + if (rc .ne. ESMF_SUCCESS) then + val = MISSINGVAL_ERROR + elseif (ustring .eq. 'MISSINGVAL_IGNORE') then + val = MISSINGVAL_IGNORE + elseif (ustring .eq. 'MISSINGVAL_FAIL') then + val = MISSINGVAL_FAIL + elseif (ustring .eq. 'MISSINGVAL_SKPCPY') then + val = MISSINGVAL_SKPCPY + else + val = MISSINGVAL_ERROR + endif + end subroutine missingval_frString + + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "field_init_eq" + function field_init_eq(val1, val2) + logical field_init_eq + type(field_init_flag), intent(in) :: val1, val2 + field_init_eq = (val1%opt == val2%opt) + end function field_init_eq + + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "field_init_toString" + subroutine field_init_toString(string, val) + character(len=*), intent(out) :: string + type(field_init_flag), intent(in) :: val + if (val == FLD_INIT_ZERO) then + write(string,'(a)') 'FLD_INIT_ZERO' + elseif (val == FLD_INIT_MODEL) then + write(string,'(a)') 'FLD_INIT_MODEL' + elseif (val == FLD_INIT_FILLV) then + write(string,'(a)') 'FLD_INIT_FILLV' + elseif (val == FLD_INIT_IMPORT) then + write(string,'(a)') 'FLD_INIT_IMPORT' + else + write(string,'(a)') 'FLD_INIT_ERROR' + endif + end subroutine field_init_toString + + !----------------------------------------------------------------------------- + +#undef METHOD +#define METHOD "field_init_frString" + subroutine field_init_frString(val, string) + type(field_init_flag), intent(out) :: val + character(len=*), intent(in) :: string + character(len=16) :: ustring + integer :: rc + ustring = ESMF_UtilStringUpperCase(string, rc=rc) + if (rc .ne. ESMF_SUCCESS) then + val = FLD_INIT_ERROR + elseif (ustring .eq. 'FLD_INIT_ZERO') then + val = FLD_INIT_ZERO + elseif (ustring .eq. 'FLD_INIT_MODEL') then + val = FLD_INIT_MODEL + elseif (ustring .eq. 'FLD_INIT_FILLV') then + val = FLD_INIT_FILLV + elseif (ustring .eq. 'FLD_INIT_MISSING') then + val = FLD_INIT_FILLV + elseif (ustring .eq. 'FLD_INIT_IMPORT') then + val = FLD_INIT_IMPORT + else + val = FLD_INIT_ERROR + endif + end subroutine field_init_frString + + !----------------------------------------------------------------------------- + +end module diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 index 159f21cca..1c6d0bf24 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Gluecode.F90 @@ -24,6 +24,7 @@ #define T_EXIT(region) #endif +!> @file LIS_NUOPC_Gluecode.F90 LIS NUOPC Gluecode interfaces module LIS_NUOPC_Gluecode !BOP ! @@ -165,6 +166,7 @@ module LIS_NUOPC_Gluecode LIS_FORC_CO2 use LIS_ESMF_Extensions use LIS_NUOPC_DataCopy + use LIS_NUOPC_Flags IMPLICIT NONE @@ -663,10 +665,9 @@ subroutine LIS_NUOPC_Init(vm,configFile,rc) ! !ROUTINE: LIS_NUOPC_DataInit ! ! !INTERFACE: - subroutine LIS_NUOPC_DataInit(nest,importState,exportState,rc) + subroutine LIS_NUOPC_DataInit(nest,exportState,rc) ! !ARGUMENTS: integer,intent(in) :: nest - type(ESMF_State),intent(inout) :: importState type(ESMF_State),intent(inout) :: exportState integer,intent(out) :: rc @@ -700,13 +701,15 @@ subroutine LIS_NUOPC_DataInit(nest,importState,exportState,rc) ! !ROUTINE: LIS_NUOPC_Run ! ! !INTERFACE: - subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) + subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock, & + misg_import,rc) ! !ARGUMENTS: integer,intent(in) :: nest integer,intent(in) :: mode type(ESMF_State),intent(inout) :: importState type(ESMF_State),intent(inout) :: exportState type(ESMF_Clock),intent(in) :: clock + type(missingval_flag),intent(in) :: misg_import integer,intent(out) :: rc ! ! !DESCRIPTION: @@ -751,13 +754,14 @@ subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) stopTime = currTime + timeStep ! Confirm if the timemgr should receive current time or stop time +! call ESMF_TimeGet(stopTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=rc) call ESMF_TimeGet(stopTime, yy=yy, mm=mm, dd=dd, h=h, m=m, s=s, rc=rc) if(ESMF_STDERRORCHECK(rc)) return call LIS_timemgr_set(LIS_rc, yy, mm, dd, h, m, s, 0, 0.0) T_ENTER("datacopy") - call LIS_ImportFieldsCopy(nest,importState,rc=rc) + call LIS_ImportFieldsCopy(nest,importState,misg_import,rc=rc) T_EXIT("datacopy") if(ESMF_STDERRORCHECK(rc)) return @@ -816,7 +820,6 @@ subroutine LIS_NUOPC_Run(nest,mode,importState,exportState,clock,rc) T_ENTER("pertrest") call LIS_perturb_writerestart(nest) T_EXIT("pertrest") - T_ENTER("darun") call LIS_dataassim_run(nest) T_EXIT("darun") @@ -983,6 +986,8 @@ subroutine LIS_NUOPC_Final(nest,clock,rc) LIS_rc%endtime = 1 + call lisfinalize(trim(LIS_rc%runmode)//char(0)) + #ifdef DEBUG call ESMF_LogWrite(MODNAME//": leaving "//METHOD, ESMF_LOGMSG_INFO) #endif @@ -1713,10 +1718,11 @@ subroutine LIS_HookupInit(rc) #undef METHOD #define METHOD "LIS_ImportFieldsCopy" - subroutine LIS_ImportFieldsCopy(nest,importState,label,rc) + subroutine LIS_ImportFieldsCopy(nest,importState,missing,label,rc) ! ARGUMENTS integer,intent(in) :: nest type(ESMF_State),intent(inout) :: importState + type(missingval_flag),intent(in) :: missing character(*),intent(in),optional :: label integer,intent(out) :: rc ! LOCAL VARIABLES @@ -1758,17 +1764,17 @@ subroutine LIS_ImportFieldsCopy(nest,importState,label,rc) if (LIS_rc%lsm.eq."Noah.3.3") then call LIS_CopyToNoah_3_3(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & - nest=nest,rc=rc) + nest=nest,missing=missing,rc=rc) if(ESMF_STDERRORCHECK(rc)) return else if (LIS_rc%lsm.eq."NoahMP.3.6") then call LIS_CopyToNoahMP_3_6(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & - nest=nest,rc=rc) + nest=nest,missing=missing,rc=rc) if(ESMF_STDERRORCHECK(rc)) return else if (LIS_rc%lsm.eq."Noah-MP.4.0.1") then call LIS_CopyToNoahMP_4_0_1(field=importField, & stdName=LIS_FieldList(fIndex)%stdName, & - nest=nest,rc=rc) + nest=nest,missing=missing,rc=rc) if(ESMF_STDERRORCHECK(rc)) return else call ESMF_LogSetError(ESMF_RC_NOT_IMPL, & @@ -2083,7 +2089,7 @@ function LIS_GridCreate(nest,rc) type(ESMF_DistGrid) :: distGrid character(len=10) :: did integer :: petID, deID - integer :: istart, jstart + integer :: start(2) integer :: id, col, row real :: lat_cor, lon_cor real :: lat_cen, lon_cen @@ -2126,7 +2132,7 @@ function LIS_GridCreate(nest,rc) rc=rc) if (ESMF_STDERRORCHECK(rc)) return - call LIS_DecompGet(distgrid,istart=istart,jstart=jstart,rc=rc) + call LIS_DecompGet(distgrid,istart=start(1),jstart=start(2),rc=rc) if (ESMF_STDERRORCHECK(rc)) return deallocate(deBlockList,petMap,stat=stat) @@ -2171,10 +2177,10 @@ function LIS_GridCreate(nest,rc) endif call LIS_ESMF_NetcdfReadIXJX("lon",trim(LIS_rc%paramfile(nest)), & - (/istart,jstart/),coordXcenter,rc) + start,coordXcenter,rc) if (ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_NetcdfReadIXJX("lat",trim(LIS_rc%paramfile(nest)), & - (/istart,jstart/),coordYcenter,rc) + start,coordYcenter,rc) if (ESMF_STDERRORCHECK(rc)) return ! Add Grid Mask @@ -2189,7 +2195,7 @@ function LIS_GridCreate(nest,rc) farrayPtr=gridmask, rc=rc) if (ESMF_STDERRORCHECK(rc)) return call LIS_ESMF_NetcdfReadIXJX("LANDMASK",trim(LIS_rc%paramfile(nest)), & - (/istart,jstart/),gridmask,rc) + start,gridmask,rc) if (ESMF_STDERRORCHECK(rc)) return #ifdef DEBUG @@ -2618,6 +2624,9 @@ subroutine LIS_Log(label,rc) mIndex,"): ",trim(LIS_rc%metforc(mIndex)) call ESMF_LogWrite(trim(logMsg), ESMF_LOGMSG_INFO) enddo + write (logMsg,"(A,A,A)") trim(l_label), & + " Met forcing blending: ", trim(LIS_rc%metforc_blend_alg) + call ESMF_LogWrite(trim(logMsg), ESMF_LOGMSG_INFO) endif do nIndex=1,LIS_rc%nnest diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Macros.h b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Macros.h index 634680f57..2093fcedb 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Macros.h +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Macros.h @@ -42,5 +42,5 @@ ! Define Missing Value !------------------------------------------------------------------------------- -#define MISSINGVALUE 0 +#define MISSINGVALUE 9.99e20_ESMF_KIND_R8 diff --git a/lis/runmodes/nuopc_cpl_mode/Makefile b/lis/runmodes/nuopc_cpl_mode/Makefile index 8a8eac7f4..a16cf6911 100644 --- a/lis/runmodes/nuopc_cpl_mode/Makefile +++ b/lis/runmodes/nuopc_cpl_mode/Makefile @@ -38,14 +38,15 @@ endif # Compile with Debugging Directives # ################################# -ifeq ($(DEBUG),on) +ifneq ($(filter $(BUILD_TYPE),DEBUG Debug debug),) override ESMF_F90COMPILECPPFLAGS += -DDEBUG override ESMF_CXXCOMPILECPPFLAGS += -DDEBUG +ifneq ($(filter $(COMPILER),INTEL Intel intel),) +ESMF_F90COMPILEOPTS += -O0 -g -traceback -check arg_temp_created,bounds,format,output_conversion,stack,uninit +endif +ifneq ($(filter $(COMPILER),GNU Gnu gnu),) +ESMF_F90COMPILEOPTS += -O0 -g -Wall -Wextra -Wconversion -Wno-unused -Wno-unused-dummy-argument -fbacktrace -fimplicit-none -fcheck=all,no-pointer endif - -ifdef DBGBUILD -ESMF_F90COMPILEOPTS += -g -traceback -ESMF_CXXCOMPILEOPTS += -g -traceback endif # ########################### @@ -111,11 +112,13 @@ CAP_VERS := VERSION CAP_OBJS := LIS_NUOPC_Cap.o CAP_OBJS += LIS_NUOPC_Gluecode.o CAP_OBJS += LIS_NUOPC_DataCopy.o +CAP_OBJS += LIS_NUOPC_Flags.o CAP_OBJS += LIS_ESMF_Extensions.o CAP_MODS := lis_nuopc.mod CAP_MODS += lis_nuopc_gluecode.mod CAP_MODS += lis_nuopc_datacopy.mod +CAP_MODS += lis_nuopc_flags.mod CAP_MODS += lis_esmf_extensions.mod CAP_FILES := $(CAP_OBJS) $(CAP_MODS) $(CAP_LIB) $(CAP_VERS) $(CAP_MK) @@ -177,15 +180,18 @@ nuopcinstall: $(CAP_LIB) $(CAP_MODS) $(CAP_VERS) \ # Dependencies # ############ -LIS_NUOPC_Cap.o: LIS_NUOPC_Macros.h LIS_NUOPC_Gluecode.o \ - LIS_ESMF_Extensions.o -LIS_NUOPC_Gluecode.o: LIS_NUOPC_Macros.h LIS_NUOPC_DataCopy.o \ - LIS_ESMF_Extensions.o $(MODEL_MODS) -LIS_NUOPC_DataCopy.o: LIS_NUOPC_Macros.h $(MODEL_MODS) +LIS_NUOPC_Cap.o: LIS_NUOPC_Macros.h LIS_NUOPC_Flags.o \ + LIS_NUOPC_Gluecode.o LIS_ESMF_Extensions.o +LIS_NUOPC_Gluecode.o: LIS_NUOPC_Macros.h LIS_NUOPC_Flags.o \ + LIS_NUOPC_DataCopy.o LIS_ESMF_Extensions.o $(MODEL_MODS) +LIS_NUOPC_DataCopy.o: LIS_NUOPC_Macros.h LIS_NUOPC_Flags.o \ + $(MODEL_MODS) +LIS_NUOPC_Flags.o: LIS_NUOPC_Macros.h lis_nuopc.mod: LIS_NUOPC_Cap.o lis_nuopc_gluecode.mod: LIS_NUOPC_Gluecode.o lis_nuopc_datacopy.mod: LIS_NUOPC_DataCopy.o +lis_nuopc_flags.mod: LIS_NUOPC_Flags.o lis_esmf_extensions.mod: LIS_ESMF_Extensions.o # ########### diff --git a/lis/runmodes/nuopc_cpl_mode/README.md b/lis/runmodes/nuopc_cpl_mode/README.md new file mode 100644 index 000000000..a81be17a3 --- /dev/null +++ b/lis/runmodes/nuopc_cpl_mode/README.md @@ -0,0 +1,23 @@ +# Introduction + +The Land Information System (LIS) is a surface model wrapper developed +and maintained by the National Aeronautics and Space Administration (NASA). +LIS abstracts several land and ocean surface models with standard +interfaces. The LIS cap wraps LIS with NUOPC compliant interfaces. The +result is configurable surface model capable of coupling with other models +in the National Unified Operational Prediction Capability (NUOPC). As of +LIS version 7.1 only Noah v3.3, NoahMP v3.6, and NoahMP v4.0.1 have two-way +NUOPC coupling capabilities. + +For the User's Guide please see the [User's Guide](docs/1_users_guide.md). + +For the Developer's Guide please see the [Developer's Guide](docs/2_developers_guide.md). + +## Repository +The LIS NUOPC cap is included with the LISF source code +[here](https://github.com/NASA-LIS/LISF/tree/master/lis/runmodes/nuopc_cpl_mode). + +## References +- [LIS Homepage](https://lis.gsfc.nasa.gov/) +- [ESMF Homepage](https://earthsystemmodeling.org/) + diff --git a/lis/runmodes/nuopc_cpl_mode/docs/1_users_guide.md b/lis/runmodes/nuopc_cpl_mode/docs/1_users_guide.md new file mode 100644 index 000000000..12aa9dcfd --- /dev/null +++ b/lis/runmodes/nuopc_cpl_mode/docs/1_users_guide.md @@ -0,0 +1,55 @@ +# User's Guide +This document is intended for LIS NUOPC Cap users. The Developer's Guide can +be found [here](2_developers_guide.md). + +## Building and Installing +Environment Variables +- ESMFMKFILE + +NUOPC Makefile Targets +- nuopc +- nuopcinstall +- nuopcclean + +The build system in ./Makefile wraps the LIS build system +and adds the nuopc, nuopcinstall, and nuopcclean targets. Before building +make sure to configure the internal model. + +To build and install into the current directory run: + $ make nuopc + +To install into an alternative directory run: + $ make nuopcinstall DESTDIR=\ INSTDIR=\ + +To build with debugging information run: + $ make nuopc DEBUG=on + +## Model Configuration +Model attributes are used to configure the model. The cap configuration is +stored in the interal state structure see \ref type_internalstatestruct + +| Attribute | Default | Description +|----------------------|-----------------|------------------------------------------------------------------------------------- +| Verbosity | 0 | String, converted into an integer. Bit 16: LIS cap information will be logged. +| Diagnostic | 0 | String, converted into an integer. Bit 16: LIS cap diagnostics will be written. +| config\_file | lis.config | Set the LIS configuration file. +| nest\_to\_nest | false | Turn on nest to nest coupling. Each nest will be identified with an integer. +| coupled\_ensemble | false | Couple ensemble members using 3D fields with ungridded dimension. +| import\_dependency | false | Data initialization will loop until all import field dependencies are satisfied. +| output\_directory | [CNAME]\_OUTPUT | Configure the LIS Cap output directory. + +## Input and Output +Cap diagnostic output is written to the ESMF PET Logs. Cap diagnostic +output can be increased or decreased by setting the Verbosity attribute. + +NUOPC state restart write files are written depending on the +RestartInterval attribute. If set to 0 then NUOPC state restart write files +will never be written. + +LIS diagnostics output is written to the LIS logs configured in the LIS +configuration file. + +LIS output files are written to the output directory configured in the LIS +configuration file. LIS output includes LIS history files and LIS restart +files. + diff --git a/lis/runmodes/nuopc_cpl_mode/docs/2_developers_guide.md b/lis/runmodes/nuopc_cpl_mode/docs/2_developers_guide.md new file mode 100644 index 000000000..b12fb1f21 --- /dev/null +++ b/lis/runmodes/nuopc_cpl_mode/docs/2_developers_guide.md @@ -0,0 +1,73 @@ +# Developer's Guide +This document is intended for LIS NUOPC Cap developers. The User's Guide can +be found [here](1_users_guide.md). + +## NUOPC Model Phases + +### Register +During the register phase subroutines are added to the ESMF registry table. +The NUOPC driver then calls each subroutine at defined points during +initialization, run, and finalize. +| Phase | Cap Subroutines | Description +|-----------|-------------------|-------------------------------------------- +| Register | ::setservices | Register NUOPC component subroutines + +### Initialize +During the initialization phase subroutines are called to configure the +model settings, advertise fields, realize fields, initalize field data, +and initialize the model clock. +| Phase | Cap Subroutines | Description +|-----------|-------------------|-------------------------------------------- +| Initalize | ::initializep0 | Set the IPD and configure model +| Initalize | ::initializep1 | Initialize model and advertise fields +| Initalize | ::initializep3 | Realize fields +| Initalize | ::datainitialize | Initialize field data +| Initalize | ::setclock | Initialize model clock + +### Run +During the run phase subroutines are called to check the import field +timestamps and advance the model. +| Phase | Cap Subroutines | Description +|-----------|-------------------|-------------------------------------------- +| Run | ::checkimport | Check timestamp on import data +| Run | ::modeladvance | Advance model by a timestep + +### Finalize +Durint the finalize phase subroutines are called to destroy objects and +release memory. +| Phase | Cap Subroutines | Description +|-----------|-------------------|-------------------------------------------- +| Finalize | ::modelfinalize | Release memory + +## Model Fields + +The following tables list the import and export fields. + +### Import Fields + +Import fields arelisted in the import_list parameter. + +| Standard Name | Units | Model Variable | Description | Notes +| ---------------|--------|-----------------|--------------------------------------------|-------------------------------------- +| dummy_field_1 | Pa | forcing_1 | field description for first import field | | +| dummy_field_2 | kg | forcing_2 | field description for second import field | | +| dummy_field_3 | W m-2 | forcing_3 | field description for third import field | field notes + +###Export Fields + +Export fields are listed in the export_list parameter. + +| Standard Name | Units | Model Variable | Description | Notes +| ---------------|---------|-----------------|-------------------------------------------|--------------------------- +| dummy_field_1 | m | output_1 | field description for first export field | field notes +| dummy_field_2 | kg | output_2 | field description for second export field | | +| dummy_field_3 | m s-1 | output_3 | field description for third export field | field notes + +## Memory Management + +Model configuration is stored in a custom internal state data type. A +pointer to the custom internal state data type is stored in the component. + +The cap allocates new memory for each field so that 2-D coordinate points +can be translated into the LIS tiled field points. + From a672d1929120dd8098d701408e839f0d378191fd Mon Sep 17 00:00:00 2001 From: Dan Rosen Date: Wed, 29 Jan 2025 17:06:43 -0500 Subject: [PATCH 3/3] Fix specialStringList in NUOPC cap --- lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 index 356aa7a3a..13eacc383 100644 --- a/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 +++ b/lis/runmodes/nuopc_cpl_mode/LIS_NUOPC_Cap.F90 @@ -165,14 +165,14 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -371,14 +371,14 @@ subroutine InitializeP1(gcomp, importState, exportState, clock, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -594,14 +594,14 @@ subroutine InitializeP3(gcomp, importState, exportState, clock, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -878,14 +878,14 @@ subroutine DataInitialize(gcomp, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1101,14 +1101,14 @@ subroutine SetClock(gcomp, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1190,14 +1190,14 @@ subroutine CheckImport(gcomp, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1265,14 +1265,14 @@ subroutine ModelAdvance(gcomp, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return @@ -1453,14 +1453,14 @@ subroutine ModelFinalize(gcomp, rc) defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return diagnostic = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return call ESMF_AttributeGet(gcomp, name="Verbosity", value=value, & defaultValue="0", convention="NUOPC", purpose="Instance", rc=rc) if (ESMF_STDERRORCHECK(rc)) return verbosity = ESMF_UtilString2Int(value, & - specialStringList=(/"min","max","bit16","maxplus"/), & + specialStringList=(/"min ","max ","bit16 ","maxplus"/), & specialValueList=(/0,65535,65536,131071/), rc=rc) if (ESMF_STDERRORCHECK(rc)) return