diff --git a/modulefiles/gsiutils_jet.intel.lua b/modulefiles/gsiutils_jet.intel.lua index 0bc5120c..c9a002d7 100644 --- a/modulefiles/gsiutils_jet.intel.lua +++ b/modulefiles/gsiutils_jet.intel.lua @@ -1,7 +1,7 @@ help([[ ]]) -prepend_path("MODULEPATH", "/mnt/lfs4/HFIP/hfv3gfs/role.epic/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev/install/modulefiles/Core") +prepend_path("MODULEPATH", "/mnt/lfs4/HFIP/hfv3gfs/role.epic/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev-rocky8/install/modulefiles/Core") local python_ver=os.getenv("python_ver") or "3.11.6" local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0" diff --git a/src/netcdf_io/calc_analysis.fd/inc2anl.f90 b/src/netcdf_io/calc_analysis.fd/inc2anl.f90 index 6130c631..fb7ead20 100644 --- a/src/netcdf_io/calc_analysis.fd/inc2anl.f90 +++ b/src/netcdf_io/calc_analysis.fd/inc2anl.f90 @@ -242,7 +242,7 @@ subroutine add_increment(fcstvar, incvar) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! use vars_calc_analysis, only: fcstncfile, anlncfile, incr_file,& nlat, nlon, nlev, anlfile, use_nemsio_anl, & - levpe, mype + levpe, mype, jedi use module_ncio, only: Dataset, read_vardata, write_vardata, & open_dataset, close_dataset, has_var use nemsio_module @@ -251,7 +251,8 @@ subroutine add_increment(fcstvar, incvar) character(7), intent(in) :: fcstvar, incvar ! local variables real, allocatable, dimension(:,:,:) :: work3d_bg - real, allocatable, dimension(:,:) :: work3d_inc + real, allocatable, dimension(:,:) :: work3d_inc_gsi + real, allocatable, dimension(:,:,:) :: work3d_inc_jedi real, allocatable, dimension(:) :: work1d integer :: j,jj,k,krev,iret type(Dataset) :: incncfile @@ -263,12 +264,22 @@ subroutine add_increment(fcstvar, incvar) call read_vardata(fcstncfile, fcstvar, work3d_bg, nslice=k, slicedim=3) ! get increment incncfile = open_dataset(incr_file, paropen=.true.) - call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc, nslice=k, slicedim=3) - ! add increment to background - do j=1,nlat - jj=nlat+1-j ! increment is S->N, history files are N->S - work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc(:,jj) - end do + ! JEDI-derived increments have a time dimension, so read to appropriate array + if ( jedi ) then + call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc_jedi, nslice=k, slicedim=3) + ! add increment to background + do j=1,nlat + jj=nlat+1-j ! increment is S->N, history files are N->S + work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc_jedi(:,jj,1) + end do + else + call read_vardata(incncfile, trim(incvar)//"_inc", work3d_inc_gsi, nslice=k, slicedim=3) + ! add increment to background + do j=1,nlat + jj=nlat+1-j ! increment is S->N, history files are N->S + work3d_bg(:,j,1) = work3d_bg(:,j,1) + work3d_inc_gsi(:,jj) + end do + end if ! write out analysis to file if (use_nemsio_anl) then allocate(work1d(nlat*nlon)) @@ -283,7 +294,12 @@ subroutine add_increment(fcstvar, incvar) end if end do ! clean up and close - deallocate(work3d_bg, work3d_inc) + if ( jedi ) then + deallocate(work3d_inc_jedi) + else + deallocate(work3d_inc_gsi) + end if + deallocate(work3d_bg) call close_dataset(incncfile) else write(6,*) fcstvar, ' not in background file, skipping...' diff --git a/src/netcdf_io/calc_analysis.fd/init_calc_analysis.f90 b/src/netcdf_io/calc_analysis.fd/init_calc_analysis.f90 index d1ab70fa..d3832900 100644 --- a/src/netcdf_io/calc_analysis.fd/init_calc_analysis.f90 +++ b/src/netcdf_io/calc_analysis.fd/init_calc_analysis.f90 @@ -15,7 +15,7 @@ subroutine read_nml !! read in namelist parameters from !! calc_analysis.nml file in same directory !! as executable - use vars_calc_analysis, only: anal_file, fcst_file, incr_file, aero_file, use_nemsio_anl, do_aero, fhr, mype, npes + use vars_calc_analysis, only: anal_file, fcst_file, incr_file, aero_file, use_nemsio_anl, do_aero, fhr, mype, npes, jedi implicit none ! local variables to this subroutine character(len=500) :: datapath = './' @@ -26,11 +26,11 @@ subroutine read_nml character(len=2) :: hrstr integer, parameter :: lunit = 10 logical :: lexist = .false. - namelist /setup/ datapath, analysis_filename, firstguess_filename, increment_filename, aero_inc_filename, fhr, use_nemsio_anl, do_aero + namelist /setup/ datapath, analysis_filename, firstguess_filename, increment_filename, aero_inc_filename, fhr, use_nemsio_anl, do_aero, jedi fhr = 6 ! default to 6 hour cycle only use_nemsio_anl = .false. ! default to using netCDF for background and analysis - do_aero = .false. ! do we process the aerosol increments? + jedi = .false. ! default to GSI (not JEDI) ! read in the namelist inquire(file='calc_analysis.nml', exist=lexist) @@ -72,6 +72,7 @@ subroutine read_nml else write(6,*) 'writing analysis in netCDF format' end if + write(6,*) 'Use JEDI format = ', jedi end if end subroutine read_nml diff --git a/src/netcdf_io/calc_analysis.fd/vars_calc_analysis.f90 b/src/netcdf_io/calc_analysis.fd/vars_calc_analysis.f90 index d28eb38f..6b9dc8e4 100644 --- a/src/netcdf_io/calc_analysis.fd/vars_calc_analysis.f90 +++ b/src/netcdf_io/calc_analysis.fd/vars_calc_analysis.f90 @@ -30,6 +30,7 @@ module vars_calc_analysis public :: fhr public :: mype, npes public :: levpe + public :: jedi character(len=500) :: anal_file, fcst_file, incr_file, aero_file integer, dimension(7) :: idate, jdate @@ -46,5 +47,6 @@ module vars_calc_analysis integer, dimension(7) :: fhrs_pe integer :: mype, npes integer, allocatable, dimension(:) :: levpe + logical :: jedi end module vars_calc_analysis