Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve various subroutine argument mismatches #160

Merged
merged 41 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1c6c1d8
Resolve argument mismatch errors when using gfortran
DusanJovic-NOAA Mar 24, 2022
bd588f9
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Apr 8, 2022
f5c5073
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA May 13, 2022
a90b957
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jun 14, 2022
6c87d3e
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jul 5, 2022
02eb368
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Jul 19, 2022
16ef7f2
Declare variables passed to w3nco library as double precission
DusanJovic-NOAA Jul 19, 2022
696c0ea
More argument mismatch fixes
DusanJovic-NOAA Jul 20, 2022
9da6d0e
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Aug 10, 2022
2686cd1
Merge remote-tracking branch 'origin/main' into no_arg_mismatch
DusanJovic-NOAA Sep 28, 2022
d1e061d
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Oct 13, 2022
3302938
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Oct 17, 2022
af99a17
Merge branch 'ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 7, 2022
92b8c85
If MPI is used, find package
climbfuji Nov 7, 2022
6c34d5b
Merge branch 'no_arg_mismatch' of https://github.com/DusanJovic-NOAA/…
climbfuji Nov 7, 2022
f943d20
Fixed cmake if/endif mismatch
DusanJovic-NOAA Nov 18, 2022
61e03a8
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 15, 2022
0df1328
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 30, 2022
8c83308
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 16, 2023
347d745
Use mpi_f08 in rrtmgp_lw_main and rrtmgp_sw_main
DusanJovic-NOAA Mar 16, 2023
13c0276
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 29, 2023
a372112
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Apr 26, 2023
a4054ff
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA May 4, 2023
c2763f5
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jun 8, 2023
b4cb573
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jun 13, 2023
37fd3fb
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Aug 4, 2023
7307e1a
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Aug 28, 2023
bf68db2
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Sep 15, 2023
53d394d
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 1, 2023
8e52a61
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Nov 3, 2023
360a612
Update GFS_phys_time_vary.fv3.F90 to compile without '-fallow-argumen…
DusanJovic-NOAA Nov 3, 2023
ce64f1a
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Dec 18, 2023
c2f80ab
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jan 4, 2024
531cd86
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Jan 16, 2024
47d4bff
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Feb 7, 2024
bac1994
Change the type of mpi communicator in few more files
DusanJovic-NOAA Feb 7, 2024
8c68c2f
Fix mpi use statement
DusanJovic-NOAA Feb 7, 2024
dbef1a7
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Feb 26, 2024
bb9b90f
Update MPI find_package and check if MPI F08 module is supported
DusanJovic-NOAA Feb 26, 2024
0cb5d97
Remove C from MPI find_package
DusanJovic-NOAA Feb 27, 2024
94596b3
Merge remote-tracking branch 'origin/ufs/dev' into no_arg_mismatch
DusanJovic-NOAA Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.3)
cmake_minimum_required(VERSION 3.10)

project(ccpp_physics
VERSION 5.0.0
Expand All @@ -8,6 +8,13 @@ project(ccpp_physics
set(PACKAGE "ccpp-physics")
set(AUTHORS "Grant Firl" "Dustin Swales" "Man Zhang" "Mike Kavulich" )

#------------------------------------------------------------------------------
# Set MPI flags for Fortran with MPI F08 interface
find_package(MPI REQUIRED Fortran)
if(NOT MPI_Fortran_HAVE_F08_MODULE)
message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface")
endif()

#------------------------------------------------------------------------------
# Set OpenMP flags for C/C++/Fortran
if (OPENMP)
Expand Down
9 changes: 1 addition & 8 deletions physics/GWD/cires_tauamf_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd)
integer :: jdow, jdoy, jday
real(8) :: rinc(5)
real(4) :: rinc4(5)
integer :: w3kindreal, w3kindint

integer :: iw3jdn
integer :: jd1, jddd
Expand All @@ -196,13 +195,7 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd)
rinc(1:5) = 0.
rinc(2) = fhour
!
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4 = rinc
call w3movdat(rinc4, idat,jdat)
else
call w3movdat(rinc, idat,jdat)
endif
call w3movdat(rinc, idat,jdat)
! jdate(8)- date and time (yr, mo, day, [tz], hr, min, sec)
jdow = 0
jdoy = 0
Expand Down
4 changes: 2 additions & 2 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
nthreads, blkno, errmsg, errflg)

#ifdef MPI

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CCPP framework developers decided to remove the remaining ifdef MPI and associated build system logic to pass -DMPI in a follow-up PR, since these changes would make your PR even larger.

use mpi
use mpi_f08
#endif
#ifdef _OPENMP
use omp_lib
Expand Down Expand Up @@ -1055,7 +1055,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
nthreads, blkno, errmsg, errflg)

#ifdef MPI
use mpi
use mpi_f08
#endif
#ifdef _OPENMP
use omp_lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ subroutine GFS_phys_time_vary_timestep_init (
real(kind_phys) :: rannie(cny)
real(kind_phys) :: rndval(cnx*cny*nrcm)
real(kind_dbl_prec) :: rinc(5)
real(kind_sngl_prec) :: rinc4(5)

! Initialize CCPP error handling variables
errmsg = ''
Expand All @@ -813,7 +812,7 @@ subroutine GFS_phys_time_vary_timestep_init (
!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) &
!$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) &
!$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) &
!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc,rinc4) &
!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc) &
!$OMP shared(w3kindreal,w3kindint,jdow,jdoy,jday) &
!$OMP private(iseed,iskip,i,j,k)

Expand Down Expand Up @@ -873,13 +872,7 @@ subroutine GFS_phys_time_vary_timestep_init (
idat(5)=idate(1)
rinc=0.
rinc(2)=fhour
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4=rinc
CALL w3movdat(rinc4,idat,jdat)
else
CALL w3movdat(rinc,idat,jdat)
endif
CALL w3movdat(rinc,idat,jdat)
jdow = 0
jdoy = 0
jday = 0
Expand Down
18 changes: 3 additions & 15 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,

real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_sngl_prec) :: rinc4(5)
real(kind=kind_dbl_prec) :: rinc8(5)

integer :: w3kindreal,w3kindint
integer :: iw3jdn
integer :: jd0, jd1
real :: fjd
Expand All @@ -115,19 +113,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr,

!--- jdat is being updated directly inside of FV3GFS_cap.F90
!--- update calendars and triggers
call w3kind(w3kindreal,w3kindint)
if (w3kindreal == 8) then
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
else if (w3kindreal == 4) then
rinc4(1:5) = 0
call w3difdat(jdat,idat,4,rinc4)
sec = rinc4(4)
else
write(0,*)' FATAL ERROR: Invalid w3kindreal'
call abort
endif
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
phour = sec/con_hr
!--- set current bucket hour
zhour = phour
Expand Down
18 changes: 3 additions & 15 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &

real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys
real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_sngl_prec) :: rinc4(5)
real(kind=kind_dbl_prec) :: rinc8(5)

integer :: w3kindreal,w3kindint
integer :: iw3jdn
integer :: jd0, jd1
real :: fjd
Expand All @@ -114,19 +112,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, &
!--- jdat is being updated directly inside of the time integration
!--- loop of scm.F90
!--- update calendars and triggers
call w3kind(w3kindreal,w3kindint)
if (w3kindreal == 8) then
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
else if (w3kindreal == 4) then
rinc4(1:5) = 0
call w3difdat(jdat,idat,4,rinc4)
sec = rinc4(4)
else
write(0,*)' FATAL ERROR: Invalid w3kindreal'
call abort
endif
rinc8(1:5) = 0
call w3difdat(jdat,idat,4,rinc8)
sec = rinc8(4)
phour = sec/con_hr
!--- set current bucket hour
zhour = phour
Expand Down
51 changes: 22 additions & 29 deletions physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ SUBROUTINE read_cidata (me, master)
integer, intent(in) :: me
integer, intent(in) :: master
!--- locals
integer :: ncerr
integer :: i, n, k, ncid, varid,j,it
real(kind=kind_phys), allocatable, dimension(:) :: hyam,hybm
real(kind=4), allocatable, dimension(:,:,:) :: ci_ps
Expand All @@ -31,29 +32,29 @@ SUBROUTINE read_cidata (me, master)
allocate (ciplin(lonscip,latscip,kcipl,timeci))
allocate (ccnin(lonscip,latscip,kcipl,timeci))
allocate (ci_pres(lonscip,latscip,kcipl,timeci))
call nf_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid)
call nf_inq_varid(ncid, "lat", varid)
call nf_get_var(ncid, varid, ci_lat)
call nf_inq_varid(ncid, "lon", varid)
call nf_get_var(ncid, varid, ci_lon)
call nf_inq_varid(ncid, "PS", varid)
call nf_get_var(ncid, varid, ci_ps)
call nf_inq_varid(ncid, "hyam", varid)
call nf_get_var(ncid, varid, hyam)
call nf_inq_varid(ncid, "hybm", varid)
call nf_get_var(ncid, varid, hybm)
call nf_inq_varid(ncid, "NAAI", varid)
call nf_get_var(ncid, varid, ciplin)
ncerr = nf90_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid)
ncerr = nf90_inq_varid(ncid, "lat", varid)
ncerr = nf90_get_var(ncid, varid, ci_lat)
ncerr = nf90_inq_varid(ncid, "lon", varid)
ncerr = nf90_get_var(ncid, varid, ci_lon)
ncerr = nf90_inq_varid(ncid, "PS", varid)
ncerr = nf90_get_var(ncid, varid, ci_ps)
ncerr = nf90_inq_varid(ncid, "hyam", varid)
ncerr = nf90_get_var(ncid, varid, hyam)
ncerr = nf90_inq_varid(ncid, "hybm", varid)
ncerr = nf90_get_var(ncid, varid, hybm)
ncerr = nf90_inq_varid(ncid, "NAAI", varid)
ncerr = nf90_get_var(ncid, varid, ciplin)
do it = 1,timeci
do k=1, kcipl
ci_pres(:,:,k,it)=hyam(k)*1.e5+hybm(k)*ci_ps(:,:,it)
end do
end do
call nf_close(ncid)
call nf_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid)
call nf_inq_varid(ncid, "NPCCN", varid)
call nf_get_var(ncid, varid, ccnin)
call nf_close(ncid)
ncerr = nf90_close(ncid)
ncerr = nf90_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid)
ncerr = nf90_inq_varid(ncid, "NPCCN", varid)
ncerr = nf90_get_var(ncid, varid, ccnin)
ncerr = nf90_close(ncid)
!---
deallocate (hyam, hybm, ci_ps)
if (me == master) then
Expand Down Expand Up @@ -128,7 +129,7 @@ END SUBROUTINE setindxci
SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
iindx1,iindx2,ddx,lev, prsl, ciplout,ccnout)
!
USE MACHINE, ONLY : kind_phys
USE MACHINE, ONLY : kind_phys, kind_dbl_prec
use iccn_def
implicit none
integer i1,i2, iday,j,j1,j2,l,npts,nc,n1,n2,lev,k,i
Expand All @@ -144,10 +145,8 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
real(kind=kind_phys) ccnout(npts,lev),ccnpm(npts,kcipl)
real(kind=kind_phys) cipres(npts,kcipl), prsl(npts,lev)
real(kind=kind_phys) rjday
real(kind=kind_dbl_prec) rinc(5)
integer jdow, jdoy, jday
real(8) RINC(5)
real(4) rinc4(5)
integer w3kindreal,w3kindint
!
IDAT=0
IDAT(1)=IDATE(4)
Expand All @@ -156,13 +155,7 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, &
IDAT(5)=IDATE(1)
RINC=0.
RINC(2)=FHOUR
call w3kind(w3kindreal,w3kindint)
if(w3kindreal==4) then
rinc4=rinc
CALL W3MOVDAT(RINC4,IDAT,JDAT)
else
CALL W3MOVDAT(RINC,IDAT,JDAT)
endif
CALL W3MOVDAT(RINC,IDAT,JDAT)
!
jdow = 0
jdoy = 0
Expand Down
Loading
Loading