Skip to content

Commit 300f909

Browse files
Merge branch 'develop' into feature/sfc_climo_gen.frac
Fixes ufs-community#709.
2 parents 4b591f3 + 44b113c commit 300f909

24 files changed

+3556
-2811
lines changed

modulefiles/build.wcoss2.intel.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Load environment to compile UFS_UTILS on WCOSS2
55
cmake_ver=os.getenv("cmake_ver") or "3.20.2"
66
load(pathJoin("cmake", cmake_ver))
77

8-
PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0"
8+
PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.3.3"
99
load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver))
1010

11-
craype_ver=os.getenv("craype_ver") or "2.7.13"
11+
craype_ver=os.getenv("craype_ver") or "2.7.17"
1212
load(pathJoin("craype", craype_ver))
1313

1414
intel_ver=os.getenv("intel_ver") or "19.1.3.304"
@@ -57,7 +57,7 @@ g2_ver=os.getenv("g2_ver") or "3.4.5"
5757
load(pathJoin("g2", g2_ver))
5858

5959
-- for mpiexec command
60-
cray_pals_ver=os.getenv("cray_pals_ver") or "1.0.12"
60+
cray_pals_ver=os.getenv("cray_pals_ver") or "1.2.2"
6161
load(pathJoin("cray-pals", cray_pals_ver))
6262

6363
udunits_ver=os.getenv("udunits_ver") or "2.2.28"

parm/msis_lib/msis21.parm

524 KB
Binary file not shown.

reg_tests/chgres_cube/c96.fv3.netcdf2wam.sh

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export VCOORD_FILE=${HOMEufs}/fix/am/global_hyblev.l64.txt
1919
export INPUT_TYPE="gaussian_netcdf"
2020
export CONVERT_SFC=".false."
2121
export CONVERT_NST=".false."
22+
export WAM_PARM_FILE=${HOMEufs}/parm/msis_lib/msis21.parm
2223

2324
export CDATE=2020020200
2425

sorc/chgres_cube.fd/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ set(lib_src
2323

2424
set(exe_src chgres.F90)
2525

26+
add_subdirectory(msis2.1.fd)
27+
2628
if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
2729
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -assume byterecl")
2830
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
2931
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-0 -fdefault-real-8")
30-
32+
3133
# Turn on this argument mismatch flag for gfortran10.
3234
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
3335
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
@@ -55,6 +57,7 @@ target_link_libraries(
5557
sp::sp_d
5658
w3nco::w3nco_d
5759
esmf
60+
msis2
5861
MPI::MPI_Fortran
5962
NetCDF::NetCDF_Fortran)
6063

sorc/chgres_cube.fd/atmosphere.F90

+9-11
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module atmosphere
5151
terrain_target_grid
5252

5353
use program_setup, only : vcoord_file_target_grid, &
54-
wam_cold_start, &
54+
wam_cold_start, wam_parm_file, &
5555
cycle_year, cycle_mon, &
5656
cycle_day, cycle_hour, &
5757
regional, &
@@ -349,7 +349,7 @@ subroutine atmosphere_driver(localpet)
349349
call vintg
350350

351351
if( wam_cold_start ) then
352-
call vintg_wam (cycle_year,cycle_mon,cycle_day,cycle_hour)
352+
call vintg_wam (cycle_year,cycle_mon,cycle_day,cycle_hour,wam_parm_file)
353353
endif
354354

355355
!-----------------------------------------------------------------------------------
@@ -1521,15 +1521,17 @@ END SUBROUTINE VINTG_THOMP_MP_CLIMO
15211521
!! @param [in] month initial month
15221522
!! @param [in] day initial day
15231523
!! @param [in] hour initial hour
1524+
!! @param [in] pf path to MSIS2.1 parm file
15241525
!!
15251526
!! @author Hann-Ming Henry Juang NCEP/EMC
1526-
SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR)
1527+
SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR,PF)
15271528

15281529
IMPLICIT NONE
15291530

15301531
include 'mpif.h'
15311532

15321533
INTEGER, INTENT(IN) :: YEAR,MONTH,DAY,HOUR
1534+
CHARACTER(*), INTENT(IN) :: PF
15331535

15341536
REAL(ESMF_KIND_R8), PARAMETER :: AMO = 15.9994 ! molecular weight of o
15351537
REAL(ESMF_KIND_R8), PARAMETER :: AMO2 = 31.999 !molecular weight of o2
@@ -1650,11 +1652,9 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR)
16501652
DO K=1,LEV_TARGET
16511653
IF(P2PTR(I,J,K).le.P1PTR(I,J,LEV_INPUT)) THEN
16521654
KREF =K-1
1653-
!x print*,'VINTG_WAM: KREF P1 P2 ',KREF,P1PTR(I,J,LEV_INPUT),P2PTR(I,J,K)
1654-
GO TO 11
1655+
EXIT
16551656
ENDIF
16561657
ENDDO
1657-
11 CONTINUE
16581658
!
16591659
DO K=KREF,LEV_TARGET
16601660
COE = P2PTR(I,J,K) / P2PTR(I,J,KREF)
@@ -1683,10 +1683,9 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR)
16831683
DO K=1,LEV_TARGET
16841684
IF(P2PTR(I,J,K).le.P1PTR(I,J,LEV_INPUT)) THEN
16851685
KREF =K-1
1686-
GO TO 22
1686+
EXIT
16871687
ENDIF
16881688
ENDDO
1689-
22 CONTINUE
16901689
!
16911690
DO K=KREF,LEV_TARGET
16921691
COE = MIN(1.0, P2PTR(I,J,K) / P2PTR(I,J,KREF) )
@@ -1712,7 +1711,7 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR)
17121711
DO K=1,LEV_TARGET
17131712
PRMB(K) = P2PTR(I,J,K) * 0.01
17141713
ENDDO
1715-
CALL GETTEMP(ICDAY,1,DEGLAT,1,PRMB,LEV_TARGET,TEMP,ON,O2N,N2N)
1714+
CALL GETTEMP(ICDAY,DEGLAT,PRMB,LEV_TARGET,PF,TEMP,ON,O2N,N2N)
17161715
!
17171716
DO K=1,LEV_TARGET
17181717
SUMMASS = ON(K)*AMO+O2N(K)*AMO2+N2N(K)*AMN2
@@ -1730,10 +1729,9 @@ SUBROUTINE VINTG_WAM (YEAR,MONTH,DAY,HOUR)
17301729
DO K=1,LEV_TARGET
17311730
IF(P2PTR(I,J,K).le.P1PTR(I,J,LEV_INPUT)) THEN
17321731
KREF =K-1
1733-
GO TO 33
1732+
EXIT
17341733
ENDIF
17351734
ENDDO
1736-
33 CONTINUE
17371735
!
17381736
DO K=KREF,LEV_TARGET
17391737
T2PTR(I,J,K) = TEMP(K)

sorc/chgres_cube.fd/docs/Doxyfile.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ FILE_PATTERNS = *.F90 \
897897
# be searched for input files as well.
898898
# The default value is: NO.
899899

900-
RECURSIVE = YES
900+
RECURSIVE = NO
901901

902902
# The EXCLUDE tag can be used to specify files and/or directories that should be
903903
# excluded from the INPUT source files. This way you can easily exclude a
@@ -906,7 +906,7 @@ RECURSIVE = YES
906906
# Note that relative paths are relative to the directory from which doxygen is
907907
# run.
908908

909-
EXCLUDE = ../../fre-nctools.fd
909+
EXCLUDE =
910910

911911
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
912912
# directories that are symbolic links (a Unix file system feature) are excluded
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
include(FetchContent)
2+
include(CheckFortranCompilerFlag)
3+
4+
add_library(msis2
5+
msis_utils.F90
6+
msis_constants.F90
7+
msis_init.F90
8+
msis_gfn.F90
9+
msis_tfn.F90
10+
msis_dfn.F90
11+
msis_calc.F90
12+
msis_gtd8d.F90)
13+
14+
set_target_properties(msis2 PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include)
15+
16+
target_include_directories(msis2 INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/include)
17+
18+
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
19+
# msis_calc:bspline has argument mismatch on nodes variable
20+
target_compile_options(msis2 PRIVATE -std=legacy)
21+
endif()
22+
23+
target_link_libraries(
24+
msis2
25+
PUBLIC
26+
MPI::MPI_Fortran)

0 commit comments

Comments
 (0)