Skip to content

Commit

Permalink
Move get_namelist_file_name invocation to cable_driver_init
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanBryan51 committed Oct 25, 2024
1 parent b811a81 commit 5882b78
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
7 changes: 1 addition & 6 deletions src/offline/cable_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ PROGRAM cable_offline_driver
IS_LEAPYEAR, calcsoilalbedo, &
kwidth_gl, gw_params

USE cable_namelist_util, ONLY : get_namelist_file_name,&
CABLE_NAMELIST,arg_not_namelist
USE cable_namelist_util, ONLY : CABLE_NAMELIST, arg_not_namelist
! physical constants
USE cable_phys_constants_mod, ONLY : CTFRZ => TFRZ
USE cable_phys_constants_mod, ONLY : CEMLEAF => EMLEAF
Expand Down Expand Up @@ -312,10 +311,6 @@ PROGRAM cable_offline_driver
CALL cable_driver_init()

cable_runtime%offline = .TRUE.
!check to see if first argument passed to cable is
!the name of the namelist file
!if not use cable.nml
CALL get_namelist_file_name()

WRITE(*,*) "THE NAME LIST IS ",CABLE_NAMELIST
! Open, read and close the namelist file.
Expand Down
6 changes: 6 additions & 0 deletions src/offline/cable_driver_init.F90
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MODULE cable_driver_init_mod
USE cable_namelist_util, ONLY : get_namelist_file_name
IMPLICIT NONE
PRIVATE

Expand All @@ -9,6 +10,11 @@ MODULE cable_driver_init_mod
SUBROUTINE cable_driver_init()
! Model initialisation routine for the offline driver.

!check to see if first argument passed to cable is
!the name of the namelist file
!if not use cable.nml
CALL get_namelist_file_name()

#ifdef __MPI__
print*, "MPI"
#else
Expand Down
6 changes: 0 additions & 6 deletions src/offline/cable_mpidrv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ PROGRAM mpi_driver
USE cable_mpicommon
USE cable_mpimaster
USE cable_mpiworker
USE cable_namelist_util, ONLY: get_namelist_file_name

IMPLICIT NONE

Expand All @@ -38,11 +37,6 @@ PROGRAM mpi_driver
CALL MPI_Comm_dup (MPI_COMM_WORLD, comm, ierr)
CALL MPI_Comm_size (comm, np, ierr)

!check to see if first argument passed to cable is
!the name of the namelist file
!if not use cable.nml
CALL get_namelist_file_name()

IF (np < 2) THEN
WRITE (*,*) 'This program needs at least 2 processes to run!'
CALL MPI_Abort (comm, 0, ierr)
Expand Down
3 changes: 1 addition & 2 deletions src/offline/cable_mpimaster.F90
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ SUBROUTINE mpidrv_master (comm)
PLUME_MIP_INIT
USE CABLE_CRU, ONLY: CRU_TYPE, CRU_GET_SUBDIURNAL_MET, CRU_INIT

USE cable_namelist_util, ONLY : get_namelist_file_name,&
CABLE_NAMELIST
USE cable_namelist_util, ONLY : CABLE_NAMELIST

USE landuse_constant, ONLY: mstate,mvmax,mharvw
USE landuse_variable
Expand Down
5 changes: 2 additions & 3 deletions src/offline/cable_mpiworker.F90
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ SUBROUTINE mpidrv_worker (comm)
! PLUME-MIP only
USE CABLE_PLUME_MIP, ONLY: PLUME_MIP_TYPE

USE cable_namelist_util, ONLY : get_namelist_file_name,&
CABLE_NAMELIST

USE cable_namelist_util, ONLY : CABLE_NAMELIST

USE cbl_soil_snow_init_special_module
IMPLICIT NONE

Expand Down

0 comments on commit 5882b78

Please sign in to comment.