Skip to content

Commit

Permalink
Adding sea-ice knowledge to cobalt.
Browse files Browse the repository at this point in the history
  • Loading branch information
kshedstrom committed Jan 2, 2020
1 parent 019661d commit 11a9d83
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
34 changes: 34 additions & 0 deletions ROMS/Nonlinear/Biology/cobalt.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
USE mod_diags
USE mod_mixing
USE shapiro_mod
# if defined ICE_MODEL || defined CICE_MODEL
USE mod_ice
# endif
!
! Imported variable declarations.
!
Expand All @@ -38,6 +41,9 @@
& LBi, UBi, LBj, UBj, N(ng), NT(ng), &
& IminS, ImaxS, JminS, JmaxS, &
& nstp(ng), nnew(ng), &
#ifdef ICE_MODEL
& liold(ng), &
#endif
#ifdef MASKING
& GRID(ng) % rmask, &
# if defined WET_DRY
Expand Down Expand Up @@ -74,6 +80,9 @@
#endif
#ifdef COBALT_CARBON
& FORCES(ng) % atmCO2, &
# if defined ICE_MODEL || defined CICE_MODEL
& ICE(ng) % ai, &
# endif
#endif
#ifdef COBALT_IRON
& FORCES(ng) % soluble_fe, &
Expand Down Expand Up @@ -113,6 +122,9 @@
& LBi, UBi, LBj, UBj, UBk, UBt, &
& IminS, ImaxS, JminS, JmaxS, &
& nstp, nnew, &
#ifdef ICE_MODEL
& liold, &
#endif
#ifdef MASKING
& rmask, &
# if defined WET_DRY
Expand Down Expand Up @@ -143,6 +155,9 @@
#endif
#ifdef COBALT_CARBON
& atmCO2, &
# if defined ICE_MODEL || defined CICE_MODEL
& ai, &
# endif
#endif
#ifdef COBALT_IRON
& soluble_fe, ironsed, &
Expand Down Expand Up @@ -193,6 +208,9 @@
integer, intent(in) :: LBi, UBi, LBj, UBj, UBk, UBt
integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
integer, intent(in) :: nstp, nnew
#ifdef ICE_MODEL
integer, intent(in) :: liold
#endif

! RD: cleaning of CPP keys needed ASSUME_SHAPE, OXYGEN, CARBON !!!
#ifdef ASSUMED_SHAPE
Expand Down Expand Up @@ -232,6 +250,11 @@
#endif
# ifdef COBALT_CARBON
real(r8), intent(in) :: atmCO2(LBi:,LBj:)
# ifdef ICE_MODEL
real(r8), intent(in) :: ai(LBi:,LBj:,:)
# elif defined CICE_MODEL
real(r8), intent(in) :: ai(LBi:,LBj:)
# endif
# endif
# ifdef COBALT_IRON
real(r8), intent(in) :: soluble_fe(LBi:,LBj:)
Expand Down Expand Up @@ -296,6 +319,11 @@
#endif
# ifdef COBALT_CARBON
real(r8), intent(in) :: atmCO2(LBi:UBi,LBj:UBj)
# if defined ICE_MODEL
real(r8), intent(in) :: ai(LBi:UBi,LBj:UBj,2)
# elif defined CICE_MODEL
real(r8), intent(in) :: ai(LBi:UBi,LBj:UBj)
# endif
# endif
# ifdef COBALT_IRON
real(r8), intent(in) :: soluble_fe(LBi:UBi,LBj:UBj)
Expand Down Expand Up @@ -771,7 +799,13 @@ IF ( Master ) WRITE(stdout,*) '>>> After CALL FMS surface min/max(co3_ion) ='

! convert ppmv to partial pressure in atm
!pCO2atm(i,j) = atmCO2(i,j) * 1.0e-6
#ifdef ICE_MODEL
pCO2atm = (1.0 - ai(i,j,liold)) * atmCO2(i,j) * 1.0e-6
#elif defined CICE_MODEL
pCO2atm = (1.0 - ai(i,j)) * atmCO2(i,j) * 1.0e-6
#else
pCO2atm = atmCO2(i,j) * 1.0e-6
#endif
!pCO2surf(i,j) = cobalt%pco2_csurf(i,j) * 1.0e-6
pCO2surface = cobalt%pco2_csurf(i,j) * 1.0e-6

Expand Down
20 changes: 18 additions & 2 deletions ROMS/Utility/checkdefs.F
Original file line number Diff line number Diff line change
Expand Up @@ -1731,6 +1731,13 @@ SUBROUTINE checkdefs
is=LEN_TRIM(Coptions)+1
Coptions(is:is+13)=' M2TIDE_DIFF,'
#endif
#ifdef MASK_HACK
!
IF (Master) WRITE (stdout,20) 'MASK_HACK', &
& 'Land/Sea masking'
is=LEN_TRIM(Coptions)+1
Coptions(is:is+11)=' MASK_HACK,'
#endif
#ifdef MASKING
!
IF (Master) WRITE (stdout,20) 'MASKING', &
Expand Down Expand Up @@ -2944,6 +2951,15 @@ SUBROUTINE checkdefs
is=LEN_TRIM(Coptions)+1
Coptions(is:is+11)=' T_PASSIVE,'
# endif
# ifdef TS_HSIMT
!
IF (Master) WRITE (stdout,20) 'TS_HSIMT', &
& 'Flux corrected HSIMT 3D advection of tracers'
is=LEN_TRIM(Coptions)+1
Coptions(is:is+10)=' TS_HSIMT,'
itrcHadv=itrcHadv+1
itrcVadv=itrcVadv+1
# endif
# if defined TS_MIX_CLIMA && \
(defined TS_DIF2 || defined TS_DIF4)
!
Expand Down Expand Up @@ -3062,7 +3078,7 @@ SUBROUTINE checkdefs
# endif
# if !(defined TS_MPDATA || defined TS_A4HADVECTION || \
defined TS_C2HADVECTION || defined TS_C4HADVECTION || \
defined TS_U3HADVECTION)
defined TS_U3HADVECTION || defined TS_HSIMT)
!
IF (Master) WRITE (stdout,20) 'TS_C4HADVECTION', &
& 'Fourth-order centered horizontal advection of tracers'
Expand Down Expand Up @@ -3140,7 +3156,7 @@ SUBROUTINE checkdefs
# endif
# if !(defined TS_MPDATA || defined TS_A4VADVECTION || \
defined TS_C2VADVECTION || defined TS_C4VADVECTION || \
defined TS_SVADVECTION)
defined TS_SVADVECTION || defined TS_HSIMT)
!
IF (Master) WRITE (stdout,20) 'TS_C4VADVECTION', &
& 'Fourth-order centered vertical advection of tracers'
Expand Down
8 changes: 4 additions & 4 deletions ROMS/Utility/get_grid.F
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ SUBROUTINE get_grid (ng, model)
exit_flag=2
RETURN
END IF
# ifdef BERING_STRAIT
IF (.not.find_string(var_name,n_var,'mask2',vindex)) THEN
IF (Master) WRITE (stdout,10) 'mask2', TRIM(ncname)
# ifdef MASK_HACK
IF (.not.find_string(var_name,n_var,'mask3',vindex)) THEN
IF (Master) WRITE (stdout,10) 'mask3', TRIM(ncname)
exit_flag=2
RETURN
END IF
Expand Down Expand Up @@ -568,7 +568,7 @@ SUBROUTINE get_grid (ng, model)
& EWperiodic(ng), NSperiodic(ng), &
& GRID(ng) % pmask)
# endif
# ifdef BERING_STRAIT
# ifdef MASK_HACK
!
! Read in Land/Sea masking at PSI-points.
!
Expand Down
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ ifdef USE_REPRESENTER
endif
ifdef USE_SEAICE
includes += ROMS/Nonlinear/SeaIce
includes += ROMS/SeaIce
endif
ifdef USE_TANGENT
includes += ROMS/Tangent \
Expand Down

0 comments on commit 11a9d83

Please sign in to comment.