forked from NOAA-EMC/WW3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NOAA-EMC#2 from mvertens/feature/icewav_coupling
updates to ww3 cap code for ww3/cice coupling
- Loading branch information
Showing
7 changed files
with
1,077 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
!> @file wav_kind_mod | ||
!! | ||
!> Precision and kind constants | ||
!! | ||
!> @details Contains public definitions of variable types and constants | ||
!! | ||
!> @author [email protected], [email protected] | ||
!> @date 01-05-2022 | ||
module wav_kind_mod | ||
|
||
!---------------------------------------------------------------------------- | ||
! precision/kind constants add data public | ||
!---------------------------------------------------------------------------- | ||
public | ||
integer,parameter :: SHR_KIND_R8 = selected_real_kind(12) ! 8 byte real | ||
integer,parameter :: SHR_KIND_R4 = selected_real_kind( 6) ! 4 byte real | ||
integer,parameter :: SHR_KIND_RN = kind(1.0) ! native real | ||
integer,parameter :: SHR_KIND_I8 = selected_int_kind (13) ! 8 byte integer | ||
integer,parameter :: SHR_KIND_I4 = selected_int_kind ( 6) ! 4 byte integer | ||
integer,parameter :: SHR_KIND_IN = kind(1) ! native integer | ||
integer,parameter :: SHR_KIND_CS = 80 ! short char | ||
integer,parameter :: SHR_KIND_CM = 160 ! mid-sized char | ||
integer,parameter :: SHR_KIND_CL = 256 ! long char | ||
integer,parameter :: SHR_KIND_CX = 512 ! extra-long char | ||
integer,parameter :: SHR_KIND_CXX= 4096 ! extra-extra-long char | ||
integer,parameter :: SHR_KIND_R8 = selected_real_kind(12) !< @public 8 byte real | ||
integer,parameter :: SHR_KIND_R4 = selected_real_kind( 6) !< @public 4 byte real | ||
integer,parameter :: SHR_KIND_RN = kind(1.0) !< @public native real | ||
integer,parameter :: SHR_KIND_I8 = selected_int_kind (13) !< @public 8 byte integer | ||
integer,parameter :: SHR_KIND_I4 = selected_int_kind ( 6) !< @public 4 byte integer | ||
integer,parameter :: SHR_KIND_IN = kind(1) !< @public native integer | ||
integer,parameter :: SHR_KIND_CS = 80 !< @public short char | ||
integer,parameter :: SHR_KIND_CM = 160 !< @public mid-sized char | ||
integer,parameter :: SHR_KIND_CL = 256 !< @public long char | ||
integer,parameter :: SHR_KIND_CX = 512 !< @public extra-long char | ||
integer,parameter :: SHR_KIND_CXX= 4096 !< @public extra-extra-long char | ||
|
||
end module wav_kind_mod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,51 @@ | ||
!> @file wav_shel_inp | ||
!! | ||
!> Set up for running in shel mode | ||
!! | ||
!> @details Contains public routines to sets up IO unit numbers and to | ||
!! either reads a shel.inp file (UWM) or set the required values directly | ||
!! (CESM). | ||
!! | ||
!> @author [email protected], [email protected] | ||
!> @date 01-05-2022 | ||
module wav_shel_inp | ||
|
||
use w3odatmd, only: nogrp, ngrpp | ||
use w3odatmd , only : nogrp, ngrpp | ||
use wav_shr_mod , only : wav_coupling_to_cice | ||
|
||
implicit none | ||
private ! except | ||
|
||
public :: set_shel_io | ||
public :: set_shel_inp | ||
public :: read_shel_inp | ||
public :: set_shel_io !< @public set the IO unit numbers | ||
public :: set_shel_inp !< @public directly set required input variabls (CESM) | ||
public :: read_shel_inp !< @public read ww3_shel.inp (UWM) | ||
|
||
integer, public :: odat(40) | ||
character(len=40), allocatable, public :: pnames(:) | ||
integer, public :: odat(40) !< @public output dates | ||
character(len=40), allocatable, public :: pnames(:) !< @public point names | ||
|
||
integer, public :: npts | ||
integer, public :: iprt(6) | ||
logical, public :: prtfrm | ||
logical, public :: flgrd(nogrp,ngrpp) !flags for gridded output | ||
logical, public :: flgr2(nogrp,ngrpp) !flags for coupling output | ||
logical, public :: flgd(nogrp) !flags for whole group - not currently used in cesm | ||
logical, public :: flg2(nogrp) !flags for whole group - not currently used in cesm | ||
real, allocatable, public :: x(:), y(:) | ||
integer, public :: npts !< @public number of points for point output | ||
integer, public :: iprt(6) !< @public partitioning grid information | ||
logical, public :: prtfrm !< @public partitioning format flag | ||
logical, public :: flgrd(nogrp,ngrpp) !< @public flags for gridded output | ||
logical, public :: flgr2(nogrp,ngrpp) !< @public flags for coupling output | ||
logical, public :: flgd(nogrp) !< @public flags for whole group - not currently used in cesm | ||
logical, public :: flg2(nogrp) !< @public flags for whole group - not currently used in cesm | ||
real, allocatable, public :: x(:) !< @public x locations for point output | ||
real, allocatable, public :: y(:) !< @public y locations for point output | ||
|
||
include "mpif.h" | ||
|
||
!=============================================================================== | ||
contains | ||
!=============================================================================== | ||
|
||
!> Set IO unit numbers | ||
!! | ||
!! @param[in] stdout unit number for stdout | ||
!! @param[out] mds an array of 13 unit numbers | ||
!! @param[out] ntrace an array of 2 unit numbers used for trace output | ||
!! | ||
!> @author [email protected], [email protected] | ||
!> @date 01-05-2022 | ||
subroutine set_shel_io(stdout,mds,ntrace) | ||
|
||
use ESMF, only : ESMF_UtilIOUnitGet | ||
|
@@ -79,13 +98,17 @@ subroutine set_shel_io(stdout,mds,ntrace) | |
ntrace(2) = 10 | ||
|
||
end subroutine set_shel_io | ||
|
||
!> Set up variables used in shel mode directly (CESM) | ||
!! | ||
!! @param[in] dtime_sync coupling interval in s | ||
!! | ||
!> @author [email protected], [email protected] | ||
!> @date 01-05-2022 | ||
subroutine set_shel_inp(dtime_sync) | ||
|
||
use w3idatmd , only : inflags1, inflags2 | ||
use w3odatmd , only : noge, idout, nds, notype, iaproc, napout | ||
use w3wdatmd , only : time | ||
use wav_shr_mod , only : wav_coupling_to_cice | ||
|
||
! Input parameter | ||
integer , intent(in) :: dtime_sync | ||
|
@@ -325,6 +348,12 @@ subroutine set_shel_inp(dtime_sync) | |
end subroutine set_shel_inp | ||
|
||
!=============================================================================== | ||
!> Read ww3_shel.inp (UWM) | ||
!! | ||
!! @param[in] mpi_comm mpi communicator | ||
!! | ||
!> @author [email protected], [email protected] | ||
!> @date 01-05-2022 | ||
subroutine read_shel_inp(mpi_comm) | ||
|
||
USE W3GDATMD, ONLY: FLAGLL | ||
|
@@ -437,7 +466,11 @@ subroutine read_shel_inp(mpi_comm) | |
! If using experimental mud or ice physics, additional lines will | ||
! be read in from ww3_shel.inp and applied, so JFIRST is changed from | ||
! its initialization setting "JFIRST=1" to some lower value. | ||
JFIRST=1 | ||
if (wav_coupling_to_cice) then | ||
JFIRST=-7 | ||
else | ||
JFIRST=1 | ||
end if | ||
|
||
! process old ww3_shel.inp format | ||
OPEN (NDSI,FILE=TRIM(FNMPRE)//'ww3_shel.inp',STATUS='OLD',IOSTAT=IERR) | ||
|
Oops, something went wrong.