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

Fix type mismatch compiler error when gfortran 10 is used without '-fallow-argument-mismatch' flag #74

Merged
merged 10 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion cellular_automata_global.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp
nca,ncells,nlives,nfracseed,nseed,iseed_ca, mytile, &
ca_smooth,nspinup,blocksize,nsmooth,ca_amplitude,mpiroot,mpicomm)

use mpi_f08
use kinddef, only: kind_dbl_prec, kind_phys
use update_ca, only: update_cells_global,define_ca_domain
use halo_exchange, only: atmosphere_scalar_field_halo
Expand All @@ -30,7 +31,8 @@ subroutine cellular_automata_global(kstep,restart,first_time_step,ca1_cpl,ca2_cp

!This program evolves a cellular automaton uniform over the globe

integer, intent(in) :: kstep,ncells,nca,nlives,nseed,nspinup,nsmooth,mpiroot,mpicomm
integer, intent(in) :: kstep,ncells,nca,nlives,nseed,nspinup,nsmooth,mpiroot
type(MPI_Comm), intent(in) :: mpicomm
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
integer, intent(in) :: mytile
real(kind=kind_phys), intent(in) :: nfracseed,ca_amplitude
Expand Down
4 changes: 3 additions & 1 deletion cellular_automata_sgs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak
nca,ncells,nlives,nfracseed,nseed,iseed_ca,ca_advect, &
nspinup,ca_trigger,blocksize,mpiroot,mpicomm)

use mpi_f08
use kinddef, only: kind_phys,kind_dbl_prec
use update_ca, only: update_cells_sgs, define_ca_domain
use random_numbers, only: random_01_CB
Expand Down Expand Up @@ -44,7 +45,8 @@ subroutine cellular_automata_sgs(kstep,dtf,restart,first_time_step,sst,lsmsk,lak
!CA_DEEP can be either number of plumes in a cluster (nca_plumes=true) or updraft
!area fraction (nca_plumes=false)

integer,intent(in) :: kstep,ncells,nca,nlives,nseed,nspinup,mpiroot,mpicomm,mytile
integer,intent(in) :: kstep,ncells,nca,nlives,nseed,nspinup,mpiroot,mytile
type(MPI_Comm),intent(in) :: mpicomm
integer(kind=kind_dbl_prec), intent(in) :: iseed_ca
real(kind=kind_phys), intent(in) :: nfracseed,dtf,nthresh
logical,intent(in) :: restart,ca_trigger,first_time_step,ca_advect
Expand Down
11 changes: 6 additions & 5 deletions mpi_wrapper.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module mpi_wrapper

use mpi_f08

implicit none

private
Expand All @@ -9,12 +11,10 @@ module mpi_wrapper
public :: mp_reduce_min, mp_reduce_max, mp_reduce_sum
public :: mp_bcst, mp_alltoall

#include "mpif.h"

integer, save :: mype = -999
integer, save :: npes = -999
integer, save :: root = -999
integer, save :: comm = -999
type(MPI_Comm), save :: comm
logical, save :: initialized = .false.

integer :: ierror
Expand Down Expand Up @@ -78,7 +78,8 @@ logical function is_rootpe()
end function is_rootpe

subroutine mpi_wrapper_initialize(mpiroot, mpicomm)
integer, intent(in) :: mpiroot, mpicomm
integer, intent(in) :: mpiroot
type(MPI_Comm), intent(in) :: mpicomm
if (initialized) return
root = mpiroot
comm = mpicomm
Expand All @@ -92,7 +93,7 @@ subroutine mpi_wrapper_finalize()
mype = -999
npes = -999
root = -999
comm = -999
comm%mpi_val = -999
initialized = .false.
end subroutine mpi_wrapper_finalize

Expand Down
8 changes: 6 additions & 2 deletions stochastic_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!! the stochastic physics random pattern generators
module stochastic_physics

use mpi_f08
use kinddef, only : kind_phys, kind_dbl_prec

implicit none
Expand Down Expand Up @@ -40,7 +41,8 @@ subroutine init_stochastic_physics(levs, blksz, dtp, sppt_amp, input_nml_file_in

! Interface variables

integer, intent(in) :: levs, nlunit, nthreads, mpiroot, mpicomm
integer, intent(in) :: levs, nlunit, nthreads, mpiroot
type(MPI_Comm), intent(in) :: mpicomm
integer, intent(in) :: blksz(:)
real(kind=kind_phys), intent(in) :: dtp
real(kind=kind_phys), intent(out) :: sppt_amp
Expand Down Expand Up @@ -280,8 +282,10 @@ subroutine init_stochastic_physics_ocn(delt,geoLonT,geoLatT,nx,ny,nz,pert_epbl_i

real :: dx
integer :: k,latghf,km
type(MPI_Comm) :: mpicomm_t ! FIXME once MOM6 updates to use mpi_f90 types
rad2deg=180.0/con_pi
call mpi_wrapper_initialize(mpiroot,mpicomm)
mpicomm_t%mpi_val = mpicomm
call mpi_wrapper_initialize(mpiroot,mpicomm_t)
gis_stochy_ocn%nodes = npes
gis_stochy_ocn%mype = mype
gis_stochy_ocn%nx=nx
Expand Down