Skip to content

Commit

Permalink
Merge branch 'master' into mpaiao-pr-new-allom
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaiao authored Jul 24, 2024
2 parents 245a029 + 842966f commit 8e7a210
Show file tree
Hide file tree
Showing 192 changed files with 16,056 additions and 9,112 deletions.
23 changes: 11 additions & 12 deletions BRAMS/src/core/local_proc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ subroutine master_putdxt(master_num)
use rpara, only : &
nmachs, & ! INTENT(IN)
machnum ! INTENT(IN)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand All @@ -333,10 +336,6 @@ subroutine master_putdxt(master_num)
real :: dxtmax(maxgrds)
integer :: master_num,ierr

#if defined(RAMS_MPI)
include 'mpif.h'
#endif

! Calculating DXTMAX
do ifm = 1,ngrids
nn2 = nnxp(ifm)
Expand Down Expand Up @@ -367,10 +366,10 @@ subroutine master_putcflmax(master_num)
nmachs, & ! INTENT(IN)
machnum, & ! INTENT(IN)
mainnum ! intent(in)

#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
integer :: master_num,ierr

#if defined(RAMS_MPI)
Expand All @@ -387,11 +386,11 @@ subroutine node_getdxt(dxtmax_local)
use io_params, only : &
maxgrds ! INTENT(IN)
use node_mod, only: master_num
implicit none

#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none

real, intent(out) :: dxtmax_local(maxgrds)
integer :: ierr
#if defined(RAMS_MPI)
Expand All @@ -413,12 +412,12 @@ subroutine node_getcflmax()
cflxy, & ! INTENT(OUT)
cflz ! INTENT(OUT)
use node_mod, only : master_num
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

#if defined(RAMS_MPI)
include 'mpif.h'
#endif
integer :: ierr

#if defined(RAMS_MPI)
Expand Down
6 changes: 3 additions & 3 deletions BRAMS/src/core/model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ subroutine par_model(master_num)
ptimes ! INTENT(IN)

use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
! +------------------------------------------------------------------
Expand All @@ -284,9 +287,6 @@ subroutine par_model(master_num)

!MLO
integer :: ierr, master_num
#if defined(RAMS_MPI)
include 'mpif.h'
#endif

!ALF
real :: dxtmax_local(maxgrds)
Expand Down
4 changes: 3 additions & 1 deletion BRAMS/src/core/rammain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ program main
! invoking master/slave processes or full model process
! destroy processes
!
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand Down Expand Up @@ -65,7 +68,6 @@ program main
! For MPI interface
integer :: ierr
#if defined(RAMS_MPI)
include 'mpif.h'
include 'interface.h'
#endif
! Get input arguments (required by C interface of MPI_Init)
Expand Down
4 changes: 3 additions & 1 deletion BRAMS/src/core/rams_master.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ subroutine rams_master(ipara, nslaves, master_num, name_name)
use mem_radiate, only: ISWRTYP, ILWRTYP ! Intent(in)
use mem_leaf, only : isfcl ! Intent(in)
use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand All @@ -63,7 +66,6 @@ subroutine rams_master(ipara, nslaves, master_num, name_name)
integer :: ierr
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!MLO]

Expand Down
13 changes: 10 additions & 3 deletions BRAMS/src/core/rnode.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ subroutine rams_node()
use mem_leaf, only: isfcl ! intent(in)

use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif


implicit none

! Local Variables:
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
integer :: isendflg,isendlite,isendmean,isendboth,nt,npass,icm,ifm,nfeed
real :: wstart,totcpu,t1,w1,t6,w6
Expand Down Expand Up @@ -385,13 +388,15 @@ subroutine init_params(init)
use mem_oda
use mem_radiate, only: ISWRTYP, ILWRTYP ! Intent(in)
use mem_leaf , only: isfcl ! Intent(in)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

integer, intent(in) :: init

#if defined(RAMS_MPI)
include 'mpif.h'
include 'interface.h'
#endif
integer :: ierr
Expand Down Expand Up @@ -438,6 +443,9 @@ subroutine init_fields(init)
use mem_cuparm, only : nclouds
use mem_aerad , only : nwave
use grid_dims , only : ndim_types
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Arguments. ----------------------------------------------------------------------!
Expand Down Expand Up @@ -473,7 +481,6 @@ subroutine init_fields(init)
!----- Include modules. ----------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!---------------------------------------------------------------------------------------!

Expand Down
10 changes: 5 additions & 5 deletions BRAMS/src/ed2/edcp_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ subroutine ed_coup_driver()
use budget_utils , only : ed_init_budget ! ! sub-routine
use ed_type_init , only : ed_init_viable ! ! sub-routine
use soil_respiration , only : zero_litter_inputs ! ! sub-routine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Local variables. ----------------------------------------------------------------!
Expand All @@ -63,17 +66,14 @@ subroutine ed_coup_driver()
integer :: jd2
integer :: ierr
integer :: igr
integer :: ping
integer :: ping
logical :: new_day
real :: wtime1
real :: wtime2
real :: wtime_start ! wall time
real :: cputime1
!----- External function. --------------------------------------------------------------!
real , external :: walltime ! wall time
!----- MPI header. ---------------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
#endif
!---------------------------------------------------------------------------------------!


Expand Down
30 changes: 14 additions & 16 deletions BRAMS/src/ed2/edcp_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ subroutine master_ed_init(iparallel)
, allocate_edglobals & ! subroutine
, allocate_edtype & ! subroutine
, edgrid_g ! ! intent(inout)
implicit none
!------Included variables. -------------------------------------------------------------!
!------MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: iparallel
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -108,11 +108,11 @@ subroutine node_ed_init
, allocate_edglobals & ! sub-routine
, allocate_edtype & ! sub-routine
, edgrid_g ! ! structure
implicit none
!------Included variables. -------------------------------------------------------------!
!------MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Local variables. ----------------------------------------------------------------!
integer :: ifm
integer :: ierr
Expand Down Expand Up @@ -181,12 +181,11 @@ subroutine copy_in_bramsmpi(master_num_b,mchnum_b,mynum_b,nmachs_b,machs_b,ipara
use grid_coms , only : ngrids & ! intent(out)
, nnxp & ! intent(out)
, nnyp ! ! intent(out)

implicit none
!----- Included variables. -------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif

implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer , intent(in) :: master_num_b
integer , intent(in) :: mchnum_b
Expand Down Expand Up @@ -267,11 +266,11 @@ subroutine init_master_work(ipara)
, allocate_edglobals & ! sub-routine
, allocate_edtype ! ! sub-routine
use mem_polygons , only : maxsite ! ! intent(in)
implicit none
!----- Included variables. -------------------------------------------------------------!
!----- MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: ipara
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -510,11 +509,10 @@ subroutine init_node_work()
, allocate_edglobals & ! sub-routine
, allocate_edtype ! ! sub-routine
use mem_polygons , only : maxsite ! ! sub-routine
implicit none
!----- Included variables. -------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Local variables. ----------------------------------------------------------------!
integer :: ifm
integer :: nm
Expand Down
10 changes: 4 additions & 6 deletions BRAMS/src/ed2/edcp_mpiutils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ subroutine masterput_ednl(mainnum)
, idetailed & ! intent(in)
, patch_keep ! ! intent(in)
use fusion_fission_coms , only : ifusion ! ! intent(in)
implicit none
!----- Standard common blocks. ---------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: mainnum
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -760,11 +759,10 @@ subroutine nodeget_ednl(master_num)
, idetailed & ! intent(out)
, patch_keep ! ! intent(out)
use fusion_fission_coms , only : ifusion ! ! intent(out)
implicit none
!----- Standard common blocks. ---------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: master_num
!----- Local variables. ----------------------------------------------------------------!
Expand Down
12 changes: 6 additions & 6 deletions BRAMS/src/io/error_mess.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ subroutine abort_run(reason,subr,file)
! being frozen. !
!------------------------------------------------------------------------------------------!
use node_mod, only: nmachs,mynum
implicit none
character(len=*), intent(in) :: reason,subr,file
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
character(len=*), intent(in) :: reason,subr,file
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
Expand Down Expand Up @@ -49,12 +49,12 @@ subroutine opspec_mess(reason,opssub)
! This is just a first warning to be given in the standard output. Since the namelist !
! may have more than one error, I list all the problems, then the model will stop. !
!------------------------------------------------------------------------------------------!
#if defined(RAMS_MPI)
use mpi
#endif
implicit none
character(len=*), intent(in) :: reason,opssub

#if defined(RAMS_MPI)
include 'mpif.h'
#endif
write (unit=*,fmt='(a)') ' '
write (unit=*,fmt='(a)') '----------------------------------------------------------------------------'
write (unit=*,fmt='(3(a,1x))') '>>>> ',trim(opssub),' error! in your namelist!'
Expand Down
8 changes: 6 additions & 2 deletions BRAMS/src/mpi/mpass_advec.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ subroutine node_sendadv(iaflag)
use mem_cuparm , only : nclouds ! ! intent(in)
use grid_dims , only : maxgrds ! ! intent(in)
use mem_aerad , only : nwave ! ! intent(in)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Arguments. ----------------------------------------------------------------------!
Expand All @@ -59,7 +62,6 @@ subroutine node_sendadv(iaflag)
!----- Module variables. ---------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!---------------------------------------------------------------------------------------!

Expand Down Expand Up @@ -220,12 +222,14 @@ subroutine node_getadv(iaflag)
use mem_scratch
use mem_cuparm , only : nclouds ! ! intent(in)
use mem_aerad , only : nwave ! ! intent(in)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Module variables. ---------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!----- Arguments. ----------------------------------------------------------------------!
integer , intent(in) :: iaflag
Expand Down
Loading

0 comments on commit 8e7a210

Please sign in to comment.