Skip to content

Commit

Permalink
Adding w3emc library as a module within the project and replacing cal…
Browse files Browse the repository at this point in the history
…ls to exterior w3emc dependency with local subroutines from w3emc module.

Removing sp dependency.
  • Loading branch information
scrasmussen committed Jun 8, 2024
1 parent 76cf93f commit d58a727
Show file tree
Hide file tree
Showing 12 changed files with 370 additions and 20 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ set_target_properties(ccpp_physics PROPERTIES VERSION ${PROJECT_VERSION}
target_include_directories(ccpp_physics PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

target_link_libraries(ccpp_physics PUBLIC w3emc::w3emc_d
sp::sp_d
NetCDF::NetCDF_Fortran)
target_link_libraries(ccpp_physics PUBLIC NetCDF::NetCDF_Fortran)

# Define where to install the library
install(TARGETS ccpp_physics
Expand Down
2 changes: 1 addition & 1 deletion physics/GWD/cires_tauamf_data.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module cires_tauamf_data

use w3emc, only: w3doxdat, w3kind, w3movdat
use machine, only: kind_phys
!...........................................................................................
! tabulated GW-sources: GRACILE/Ern et al., 2018 and/or Resolved GWs from C384-Annual run
Expand Down
10 changes: 5 additions & 5 deletions physics/GWD/cires_ugwpv1_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ module cires_ugwpv1_module
!...................................................................................
!
!
use machine, only : kind_phys
use ugwp_common, only : arad, pi, pi2, hpscale, rhp, rhp2, rh4, rhp4, khp, hpskm
use ugwp_wmsdis_init, only : ilaunch, nslope, lhmet, lzmax, lzmin, lzstar
use ugwp_wmsdis_init, only : tau_min, tamp_mpa
use machine, only : kind_phys
use ugwp_common, only : arad, pi, pi2, hpscale, rhp, rhp2, rh4, rhp4, khp, hpskm
use ugwp_wmsdis_init, only : ilaunch, nslope, lhmet, lzmax, lzmin, lzstar
use ugwp_wmsdis_init, only : tau_min, tamp_mpa
use w3emc, only : iw3jdn

implicit none
logical :: module_is_initialized
Expand Down Expand Up @@ -436,7 +437,6 @@ subroutine calendar_ugwp(yr, mm, dd, ddd_ugwp)
integer, intent(in) :: yr, mm, dd
integer :: ddd_ugwp

integer :: iw3jdn
integer :: jd1, jddd
jd1 = iw3jdn(yr,1,1)
jddd = iw3jdn(yr,mm,dd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
!> @{
module GFS_phys_time_vary

use w3emc, only: w3doxdat, w3kind, w3movdat

use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec

use mersenne_twister, only: random_setseed, random_number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

module GFS_time_vary_pre

use w3emc, only: iw3jdn, w3difdat, w3kind

use funcphys, only: gfuncphys

implicit none
Expand Down Expand Up @@ -93,7 +95,7 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_dbl_prec) :: rinc8(5)

integer :: iw3jdn
integer :: w3kindreal,w3kindint
integer :: jd0, jd1
real :: fjd

Expand Down
2 changes: 2 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
!! IN and CCN data.
module iccninterp

use w3emc, only: w3doxdat, w3kind, w3movdat

implicit none

private
Expand Down
2 changes: 2 additions & 0 deletions physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F
Original file line number Diff line number Diff line change
Expand Up @@ -7069,6 +7069,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, &
&, tile_num_ch, i_index, j_index)
!
use machine , only : kind_io8,kind_io4, kind_dbl_prec
use w3emc, only : w3movdat
implicit none
character(len=*), intent(in) :: tile_num_ch
integer, intent(in) :: i_index(len), j_index(len)
Expand Down Expand Up @@ -8574,6 +8575,7 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, &
&, outlat, outlon, me)
use machine , only : kind_io8,kind_dbl_prec,kind_sngl_prec
use sfccyc_module, only : mdata
use w3emc, only : w3movdat
implicit none
integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, &
& lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, &
Expand Down
1 change: 1 addition & 0 deletions physics/MP/Morrison_Gettelman/aerinterp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
!! This module contain subroutines of reading and interpolating
!! aerosol data for MG microphysics.
module aerinterp
use w3emc, only: w3doxdat, w3kind, w3movdat

implicit none

Expand Down
16 changes: 8 additions & 8 deletions physics/Radiation/radiation_astronomy.f
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
!> \brief This module sets up astronomical quantities for solar radiation
!! calculations.
!!
!! Operational GFS selection for Solar constant value
!! (namelist control parameter - \b ISOL = 2)
!! \n ISOL=0: presribed value = 1366 \f$W m^{-2}\f$ (old)
!! Operational GFS selection for Solar constant value
!! (namelist control parameter - \b ISOL = 2)
!! \n ISOL=0: presribed value = 1366 \f$W m^{-2}\f$ (old)
!! \n ISOL=10: prescibed value = 1361 \f$W m^{-2}\f$ (new)
!! \n ISOL=1: NOAA old yearly solar constant table with 11-year cycle (range: 1944-2006)
!! \n ISOL=2: NOAA new yearly solar constant table with 11-year cycle (range: 1850-2019)
Expand All @@ -86,10 +86,11 @@
!! \version NCEP-Radiation_astronomy v5.2 Jan 2013

!> This module sets up astronomy quantities for solar radiation calculations.
module module_radiation_astronomy
module module_radiation_astronomy
!
use machine, only : kind_phys
use machine, only : kind_phys
use module_iounitdef, only : NIRADSF
use w3emc, only : iw3jdn, w3fs26
!
implicit none
!
Expand Down Expand Up @@ -196,7 +197,7 @@ subroutine sol_init &
degrad = 180.0/con_pi
tpi = 2.0 * con_pi
hpi = 0.5 * con_pi
pid12 = con_pi/f12
pid12 = con_pi/f12

! --- initialization
isolflg = isolar
Expand Down Expand Up @@ -400,7 +401,6 @@ subroutine sol_update &
real (kind=kind_phys) :: fjd, fjd1, dlt, r1, alp

integer :: jd, jd1, iyear, imon, iday, ihr, imin, isec
integer :: iw3jdn
integer :: i, iyr, iyr1, iyr2, jyr, nn, nswr, icy1, icy2, icy

logical :: file_exist
Expand Down Expand Up @@ -901,7 +901,7 @@ subroutine coszmn &
coszdg(i) = coszen(i) * rstp
if (istsun(i) > 0 .and. coszen(i) /= 0.0_kind_phys) then
coszen(i) = coszen(i) / istsun(i)
endif
endif
enddo
!
return
Expand Down
2 changes: 1 addition & 1 deletion physics/SFC_Layer/UFS/module_nst_water_prop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
module module_nst_water_prop
use machine , only : kind_phys
use module_nst_parameters , only : t0k, zero, one, half
use w3emc, only : iw3jdn

implicit none
!
Expand Down Expand Up @@ -544,7 +545,6 @@ subroutine compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd)
!$$$
!
integer :: jyr,jmnth,jday,jhr,jmn,jd
integer :: iw3jdn
real (kind=kind_phys) fjd
jd=iw3jdn(jyr,jmnth,jday)
if(jhr.lt.12) then
Expand Down
2 changes: 1 addition & 1 deletion physics/photochem/h2ointerp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!> This module contains subroutines of reading and interpolating
!! h2o coefficients.
module h2ointerp

use w3emc, only: w3doxdat, w3kind, w3movdat
implicit none

private
Expand Down
Loading

0 comments on commit d58a727

Please sign in to comment.