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

Uvic ice dev #24

Open
wants to merge 102 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
7928790
added vars from ice_uvic
Jun 17, 2021
68b9b7f
adding variables
Jun 17, 2021
99e1c84
change to register_all_variables and new commits in stim
Jun 18, 2021
d0aae13
adding stim commits
Jun 18, 2021
4e49481
Merge pull request #1 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 22, 2021
3fc23e7
specified vars from stim in use:, excluded some vars from fm%register
Jun 22, 2021
057c0b9
made var in airsea public for use in ice, passing values in calls to …
Jun 28, 2021
2131e5a
adding stim
Jun 28, 2021
988c9e2
adding stim
Jun 29, 2021
af7a59e
adding stim
Jun 29, 2021
d352a63
Merge pull request #2 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
09fb79c
adding stim
Jun 30, 2021
38c4847
Merge pull request #3 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
324e98a
adding stim
Jun 30, 2021
1e674f5
Merge pull request #4 from juliaputko/uvic_ice_jp
PatrickFarnole Jun 30, 2021
46d2b36
registering vars theta,sigma,kelvin,epsilon
Jun 30, 2021
d918eb0
adding stim
Jul 1, 2021
70cba17
Merge pull request #5 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 1, 2021
709d1e5
param passing more consistent with oldcode
Jul 1, 2021
b5b0fbe
adding stim
Jul 2, 2021
d5bd9d6
Merge pull request #6 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 5, 2021
2f17194
adding stim
Jul 5, 2021
712c772
changes to resolve longwave_radiation_method value passing error
Jul 5, 2021
0526616
Merge pull request #7 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 6, 2021
cba9d0f
adding stim
Jul 8, 2021
babdc5d
adding stim
Jul 8, 2021
932c446
Merge pull request #8 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 12, 2021
7109c59
adding stim and added and removed vars from register_all_variables so…
Jul 13, 2021
9dc4846
Merge pull request #9 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 13, 2021
6f099c9
added new dimension
Jul 15, 2021
6e4d1b8
Merge pull request #10 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 16, 2021
2f08c13
info for dimensions, addition to salinity is commented, if uncommente…
Jul 20, 2021
b3e316f
Merge pull request #11 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 20, 2021
78af89a
adding flexout and stim,, removing z1,, update to Tice upper and lowe…
Jul 22, 2021
6ae31c9
Merge pull request #12 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 23, 2021
d93c90e
adding stim
Jul 24, 2021
7e959de
cleaned up
Jul 24, 2021
c22dbd7
changing bounds in register_all_variables
Jul 27, 2021
285a391
Merge pull request #13 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 27, 2021
70723e8
writing Cond on the right indexes
PatrickFarnole Jul 27, 2021
097493e
changed dimensions of ice_uvic_zi, added zice and dzice
Jul 28, 2021
7eb4765
adding stim
Jul 28, 2021
e71af8a
Merge pull request #14 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 29, 2021
74f8ad7
fixed problem with ice_uvic_zi
Jul 29, 2021
0692132
Merge pull request #15 from juliaputko/uvic_ice_jp
PatrickFarnole Jul 29, 2021
968c623
adding stim
Jul 30, 2021
a4635cd
Merge pull request #16 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 1, 2021
c93919b
changed in salinity
Aug 4, 2021
25024ff
Merge pull request #17 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 4, 2021
cbf9226
clean
Aug 4, 2021
d2aec78
adding vars from gotm_fabm.nml and fabm.nml
Aug 6, 2021
19f0a35
removed _ICE_ condition from salinity
Aug 6, 2021
e0a6754
making vars available outside of ice
Aug 6, 2021
6ac8610
Merge pull request #18 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 9, 2021
223c406
adding model uvic to fabm
Aug 9, 2021
bc861d5
changes for new model
Aug 10, 2021
9c8a1b5
Merge branch 'master' of github.com:gotm-model/code into uvic_fabm_jp
Aug 10, 2021
92e706f
Merge branch 'master' of github.com:gotm-model/code into uvic_ice_dev
PatrickFarnole Aug 11, 2021
272189a
update submodules stim, fabm and flexout.
PatrickFarnole Aug 11, 2021
1d04a55
Adding stim
PatrickFarnole Aug 11, 2021
8138ac0
synch
Aug 16, 2021
bd28648
Reference Patrick's forks for repository
Aug 20, 2021
01f8c64
Merge pull request #19 from ashao/pfarnole_submodules
PatrickFarnole Aug 23, 2021
84dbc76
adding Qfluxes_uvic
Aug 24, 2021
82932a4
Merge pull request #20 from juliaputko/uvic_ice_jp
PatrickFarnole Aug 25, 2021
f7e1abc
Merge branch 'uvic_ice_dev' of github.com:PatrickFarnole/code into uv…
PatrickFarnole Aug 26, 2021
36b06a2
Update .gitmodules
PatrickFarnole Aug 26, 2021
fdaab4f
Merge branch 'uvic_ice_dev' of github.com:PatrickFarnole/code into uv…
PatrickFarnole Aug 26, 2021
9684211
clean
Aug 24, 2021
3269b2b
adding fabm
Sep 1, 2021
9958834
adding fabm
Sep 1, 2021
9c5f155
clean
Sep 1, 2021
ac8735f
clean
Sep 1, 2021
add99fd
adding fabm
Sep 1, 2021
bffc7e7
Merge pull request #21 from juliaputko/uvic_fabm_jp
PatrickFarnole Oct 7, 2021
cfa77d9
adding fabm
Oct 7, 2021
55f1185
adding fabm
Oct 10, 2021
b55b4a2
adding fabm
Oct 10, 2021
ca7f28b
Merge pull request #22 from juliaputko/uvic_fabm_jp
PatrickFarnole Oct 19, 2021
59cd84e
merge from fabm branch
Nov 3, 2021
bdd61d8
Merge pull request #23 from juliaputko/uvic_fabm_jp
PatrickFarnole Nov 5, 2021
23738d4
Merge branch 'PatrickFarnole:master' into uvic_fabm_jp
juliaputko Nov 5, 2021
6d083ed
changes in fabm and stim
Dec 16, 2021
b1f5cf3
Merge branch 'uvic_fabm_jp' of github.com:juliaputko/code into uvic_f…
Dec 16, 2021
9815c71
adding extern/fabm,flexout/stim
Dec 21, 2021
09169bc
adding fabm - dms changes
Dec 21, 2021
5d166ae
flexout
Dec 21, 2021
f25f644
added changed from commit1 2015a027d621296bee2174bd0c8dd847f298e7fb
bolding Dec 7, 2020
4db2007
fabm
Dec 21, 2021
2590787
changes from commit 2 22dd70983da5d9e98ce2a1675fdfa8a7b
bolding Jan 27, 2021
95dc096
additional changes regarding longwave: FILE, ql_
Dec 21, 2021
de8d9d2
Merge pull request #24 from juliaputko/uvic_ice_jp
PatrickFarnole Dec 21, 2021
da17e01
Merge branch 'uvic_ice_dev' of github.com:PatrickFarnole/code into uv…
PatrickFarnole Dec 22, 2021
3b203e9
Merge branch 'uvic_ice_dev' into uvic_fabm_dev
PatrickFarnole Dec 22, 2021
60131b1
adding case(clark) and fatal error message 93, removing comments
Dec 22, 2021
182f9b9
adding stim
Dec 23, 2021
85c2f53
Merge pull request #25 from juliaputko/uvic_ice_jp
PatrickFarnole Dec 23, 2021
166d616
Merge branch 'uvic_ice_dev' of github.com:PatrickFarnole/code into uv…
PatrickFarnole Dec 23, 2021
6f1a4b8
Merge branch 'uvic_ice_dev' into uvic_fabm_dev
PatrickFarnole Dec 23, 2021
dd7de20
longwave changes
Dec 27, 2021
24689aa
indentation correction
Dec 30, 2021
2ba9663
Merge pull request #26 from juliaputko/uvic_ice_jp
PatrickFarnole Jan 5, 2022
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
8 changes: 3 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
[submodule "extern/fabm"]
path = extern/fabm
url = https://github.com/fabm-model/fabm
# url = ../../fabm-model/fabm
url = https://github.com/PatrickFarnole/fabm
[submodule "extern/flexout"]
path = extern/flexout
url = https://github.com/BoldingBruggeman/flexout
# url = ../../BoldingBruggeman/flexout
url = https://github.com/PatrickFarnole/flexout
[submodule "extern/stim"]
path = extern/stim
url = https://github.com/BoldingBruggeman/stim
url = https://github.com/PatrickFarnole/stim
[submodule "extern/CVMix-src"]
path = extern/CVMix-src
url = https://github.com/CVMix/CVMix-src.git
2 changes: 1 addition & 1 deletion extern/fabm
Submodule fabm updated 44 files
+24 −2 .github/workflows/fabm.yml
+2 −2 .zenodo.json
+9 −7 include/fabm_private.h
+69 −1 include/standard_variable_assignments.h
+18 −1 include/standard_variables.h
+10 −0 src/CMakeLists.txt
+120 −0 src/builtin/constant.F90
+104 −0 src/builtin/depth_integral.F90
+24 −0 src/builtin/reduction.F90
+55 −0 src/builtin/relaxation.F90
+94 −0 src/builtin/scale.F90
+229 −0 src/builtin/source.F90
+606 −0 src/builtin/sum.F90
+123 −0 src/builtin/time_filter.F90
+12 −0 src/drivers/python/pyfabm/__init__.py
+30 −91 src/fabm.F90
+31 −1,100 src/fabm_builtin_models.F90
+7 −7 src/fabm_coupling.F90
+354 −52 src/fabm_expressions.F90
+15 −19 src/fabm_graph.F90
+12 −15 src/fabm_job.F90
+4 −5 src/fabm_schedule.F90
+4 −5 src/fabm_standard_variables.F90
+28 −30 src/fabm_types.F90
+1 −1 src/models/niva/brom/brom_salt.F90
+1 −1 src/models/uhh/halogen/halogen.F90
+19 −0 src/models/uvic/CMakeLists.txt
+758 −0 src/models/uvic/dic.F90
+411 −0 src/models/uvic/dms.F90
+263 −0 src/models/uvic/dmsp_papa.F90
+558 −0 src/models/uvic/eco.F90
+463 −0 src/models/uvic/em_dms.F90
+276 −0 src/models/uvic/em_icedms.F90
+564 −0 src/models/uvic/hh_eco.F90
+343 −0 src/models/uvic/hh_icealgae.F90
+350 −0 src/models/uvic/icealgae.F90
+290 −0 src/models/uvic/icedms.F90
+325 −0 src/models/uvic/npzd_papa.F90
+482 −0 src/models/uvic/npzd_resolute.F90
+50 −0 src/models/uvic/uvic_model_library.F90
+224 −0 util/algorithms/running_max.ipynb
+231 −0 util/algorithms/running_mean.ipynb
+95 −0 util/standard_variables/standard_variables.wiki
+37 −1 util/standard_variables/variables.yaml
2 changes: 1 addition & 1 deletion extern/flexout
78 changes: 56 additions & 22 deletions src/airsea/airsea.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ module airsea_driver
public :: set_sst
public :: set_ssuv
public :: surface_fluxes
public :: surface_fluxes_uvic !jpnote added
public :: integrated_fluxes
#ifdef _PRINTSTATE_
public :: print_state_airsea
Expand All @@ -64,6 +65,7 @@ module airsea_driver
!
! Meteorological forcing variables
integer, public :: hum_method
integer, public :: longwave_type
character(len=PATH_MAX) :: meteo_file
type (type_scalar_input), public, target :: u10,v10
type (type_scalar_input), public, target :: airp,airt
Expand All @@ -75,10 +77,10 @@ module airsea_driver
!
! surface shortwave radiation
! and surface heat flux (W/m^2)
type (type_scalar_input), public, target :: I_0, ql
type (type_scalar_input), public, target :: I_0
REALTYPE, public, target :: albedo
type (type_scalar_input), public, target :: heat
REALTYPE, public :: qe,qh
type (type_scalar_input), public, target :: heat, ql_
REALTYPE, public :: qe,qh,ql

! surface stress components (Pa)
REALTYPE, public, target :: tx,ty
Expand Down Expand Up @@ -262,7 +264,7 @@ subroutine init_airsea_nml(namlst, fn)
REALTYPE :: const_tx,const_ty
REALTYPE :: const_precip
REALTYPE :: precip_factor
integer :: back_radiation_method
integer :: back_radiation_method
integer :: heat_method

namelist /airsea/ calc_fluxes, &
Expand Down Expand Up @@ -340,7 +342,7 @@ subroutine init_airsea_nml(namlst, fn)
call tx_%configure(method=momentum_method, path=momentumflux_file, index=1, constant_value=const_tx)
call ty_%configure(method=momentum_method, path=momentumflux_file, index=2, constant_value=const_ty)
call heat%configure(method=heat_method, path=heatflux_file, index=1, scale_factor=shf_factor, constant_value=const_heat)
call ql%configure(method=back_radiation_method, path=back_radiation_file, index=1)
call ql_%configure(method=back_radiation_method, path=back_radiation_file, index=1)
call sst_obs%configure(method=sst_method, path=sst_file, index=1)
call sss%configure(method=sss_method, path=sss_file, index=1)
call precip%configure(method=precip_method, path=precip_file, index=1, scale_factor=precip_factor, constant_value=const_precip)
Expand All @@ -354,6 +356,8 @@ subroutine init_airsea_nml(namlst, fn)
stop 'init_airsea'
91 FATAL 'I could not read airsea namelist'
stop 'init_airsea'
93 FATAL 'I could not open ',trim(meteo_file)
stop 'init_airsea'

end subroutine init_airsea_nml
!EOC
Expand Down Expand Up @@ -492,10 +496,13 @@ subroutine init_airsea_yaml()

call branch%get(I_0, 'swr', 'shortwave radiation', 'W/m^2', &
minimum=0._rk,default=0._rk, extra_options=(/option(3, 'from time, location and cloud cover', 'calculate')/))
call branch%get(ql, 'longwave_radiation', 'net longwave radiation', 'W/m^2', &
call branch%get(ql_, 'longwave_radiation', 'longwave radiation', 'W/m^2', &
default=0._rk, method_file=0, method_constant=method_unsupported, &
extra_options=(/option(CLARK, 'Clark et al. (1974)', 'Clark'), option(HASTENRATH_LAMB, 'Hastenrath and Lamb (1978)', 'Hastenrath_Lamb'), option(BIGNAMI, 'Bignami et al. (1995)', 'Bignami'), option(BERLIAND_BERLIAND, 'Berliand and Berliand (1952)', 'Berliand_Berliand'), option(JOSEY1, 'Josey et al. (2003) - 1', 'Josey1'), option(JOSEY2, 'Josey et al. (2003) - 2', 'Josey2')/), default_method=CLARK)
extra_options=(/option(CLARK, 'Clark et al. (1974)', 'Clark'), option(HASTENRATH_LAMB, 'Hastenrath and Lamb (1978)', 'Hastenrath_Lamb'), option(BIGNAMI, 'Bignami et al. (1995)', 'Bignami'), option(BERLIAND_BERLIAND, 'Berliand and Berliand (1952)', 'Berliand_Berliand'), option(JOSEY1, 'Josey et al. (2003) - 1', 'Josey1'), option(JOSEY2, 'Josey et al. (2003) - 2', 'Josey2')/), default_method=CLARK, pchild=leaf)
call leaf%get(longwave_type, 'type', 'longwave type from file', &
options=(/option(1, 'net longwave radiation'), option(2, 'incoming longwave radiation')/), default=1)


twig => branch%get_typed_child('albedo')
call twig%get(albedo_method, 'method', 'method to compute albedo', &
options=(/option(0, 'constant', 'constant'), option(PAYNE, 'Payne (1972)', 'Payne'), option(COGLEY, 'Cogley (1979)', 'Cogley')/), default=PAYNE)
Expand Down Expand Up @@ -686,10 +693,10 @@ subroutine post_init_airsea(lat,lon)
LEVEL4 'using Fairall et. all formulation'
case default
end select
LEVEL3 'net longwave radiation:'
select case (ql%method)
LEVEL3 'longwave radiation:'
select case (ql_%method)
case(0) ! Read from file instead of calculating
call register_input(ql)
call register_input(ql_)
case(CLARK)
LEVEL4 'using Clark formulation'
case(HASTENRATH_LAMB)
Expand Down Expand Up @@ -735,6 +742,36 @@ subroutine post_init_airsea(lat,lon)
end subroutine post_init_airsea
!EOC

!-----------------------------------------------------------------------
!BOP
!jpnote added
subroutine surface_fluxes_uvic(surface_temp,sensible,latent,longwave_radiation_value)
!
! !USES:
IMPLICIT NONE
!
! !INPUT PARAMETERS:
REALTYPE, intent(in) :: surface_temp
! !OUTPUT PARAMETERS:
REALTYPE, intent(out) :: sensible,latent,longwave_radiation_value
!
! LOCAL VARIABLES:
REALTYPE :: tw,tw_k,ta_k
!EOP
!-----------------------------------------------------------------------
!BOC

tw = surface_temp-KELVIN
tw_k= surface_temp
ta_k = airt%value + KELVIN

call humidity(hum_method,hum%value,airp%value,tw,airt%value)
call longwave_radiation(ql_%method,longwave_type, &
dlat,tw_k,ta_k,cloud%value,ql_%value,longwave_radiation_value)
call airsea_fluxes(fluxes_method, &
tw,airt%value,u10%value,v10%value,precip%value,evap,tx_%value,ty_%value,latent,sensible)

end subroutine surface_fluxes_uvic
!-----------------------------------------------------------------------
!BOP
subroutine surface_fluxes(surface_temp,sensible,latent,longwave_radiation)
Expand All @@ -756,10 +793,10 @@ subroutine surface_fluxes(surface_temp,sensible,latent,longwave_radiation)
latent = qe
#if 0
if (qe .lt. _ZERO_) then
STDERR 'Stefan# ',qh/qe
!KB STDERR 'Stefan# ',qh/qe
end if
#endif
longwave_radiation = ql%value
longwave_radiation = ql
return
end subroutine surface_fluxes
!EOC
Expand Down Expand Up @@ -981,18 +1018,17 @@ subroutine flux_from_meteo(jul,secs)
cloud1 = cloud2

call humidity(hum_method,hum,airp,tw,ta)
if (ql%method .gt. 0) then
call longwave_radiation(ql%method, &
dlat,tw_k,ta_k,cloud,ql)
end if
call longwave_radiation(ql_%method,longwave_type, &
dlat,tw_k,ta_k,cloud,ql_%value,ql)

#if 0
call airsea_fluxes(fluxes_method,rain_impact,calc_evaporation, &
tw,ta,u10%value-ssu,v10%value-ssv,precip%value,evap,tx2,ty2,qe,qh)
#else
call airsea_fluxes(fluxes_method, &
tw,ta,u10%value-ssu,v10%value-ssv,precip%value,evap,tx2,ty2,qe,qh)
#endif
h2 = ql%value+qe+qh
h2 = ql+qe+qh
cloud2 = cloud%value

if (init_saved_vars) then
Expand Down Expand Up @@ -1033,13 +1069,11 @@ subroutine flux_from_meteo(jul,secs)
end if

call humidity(hum_method,hum%value,airp%value,tw,ta)
if (ql%method .gt. 0) then
call longwave_radiation(ql%method, &
dlat,tw_k,ta_k,cloud%value,ql%value)
endif
call longwave_radiation(ql_%method,longwave_type, &
dlat,tw_k,ta_k,cloud%value,ql_%value,ql)
call airsea_fluxes(fluxes_method, &
tw,ta,u10%value-ssu,v10%value-ssv,precip%value,evap,tx_%value,ty_%value,qe,qh)
heat%value = (ql%value+qe+qh)
heat%value = (ql+qe+qh)
#endif

w = sqrt((u10%value-ssu)*(u10%value-ssu)+(v10%value-ssv)*(v10%value-ssv))
Expand Down
4 changes: 3 additions & 1 deletion src/airsea/airsea_variables.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module airsea_variables
REALTYPE, public, parameter :: emiss=0.97
REALTYPE, public, parameter :: bolz=5.67e-8
REALTYPE, public, parameter :: kelvin=273.15
REALTYPE, public, parameter :: const06=0.62198
REALTYPE, public, parameter :: const06=0.62198 ! molecular weight ratio between water and dry air
! 18.01528 g/mol H2O, 28.97 g/mol dry air
REALTYPE, public, parameter :: rgas = 287.1 !
REALTYPE, public, parameter :: g = 9.81 ! [m/s2]
REALTYPE, public, parameter :: rho_0 = 1025. ! [kg/m3]
Expand All @@ -46,6 +47,7 @@ module airsea_variables
integer, public, parameter :: COGLEY=2

! Longwave radiation
integer, public, parameter :: FILE = 0 ! From file
integer, public, parameter :: CLARK = 1 ! Clark et al, 1974
integer, public, parameter :: HASTENRATH_LAMB = 2 ! Hastenrath and Lamb, 1978
integer, public, parameter :: BIGNAMI = 3 ! Bignami et al., 1995 - Medsea
Expand Down
21 changes: 14 additions & 7 deletions src/airsea/longwave_radiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
! !ROUTINE: Calculate the net longwave radiation \label{sec:back-rad}
!
! !INTERFACE:
subroutine longwave_radiation(method,dlat,tw,ta,cloud,ql)
subroutine longwave_radiation(method,type,dlat,tw,ta,cloud,qlobs,ql)
!
! !DESCRIPTION:
!
! Here, the net longwave radiation is calculated by means of one out
! of six methods, which depend on the value given to the parameter
! {\tt method}:
! {\tt method}=0: read observations from a file
! {\tt method}=1: \cite{Clarketal74},
! {\tt method}=2: \cite{HastenrathLamb78},
! {\tt method}=3: \cite{Bignamietal95},
Expand All @@ -23,15 +24,15 @@ subroutine longwave_radiation(method,dlat,tw,ta,cloud,ql)
! !USES:
use airsea_variables, only: emiss,bolz
use airsea_variables, only: ea,qa
use airsea_variables, only: CLARK, HASTENRATH_LAMB, BIGNAMI, BERLIAND_BERLIAND, JOSEY1, JOSEY2
use airsea_variables, only: FILE, CLARK, HASTENRATH_LAMB, BIGNAMI, BERLIAND_BERLIAND, JOSEY1, JOSEY2
IMPLICIT NONE
!
! !INPUT PARAMETERS:
integer, intent(in) :: method
REALTYPE, intent(in) :: dlat,tw,ta,cloud
integer, intent(in) :: method,type
REALTYPE, intent(in) :: dlat,tw,ta,cloud,qlobs
!
! !OUTPUT PARAMETERS:
REALTYPE, intent(out) :: ql
REALTYPE, intent(inout) :: ql
!
! !REVISION HISTORY:
! Original author(s): Adolf Stips, Hans Burchard & Karsten Bolding
Expand Down Expand Up @@ -60,15 +61,21 @@ subroutine longwave_radiation(method,dlat,tw,ta,cloud,ql)

REALTYPE :: ccf
REALTYPE :: x1,x2,x3
!
!EOP
!-----------------------------------------------------------------------
!BOC
! calculate cloud correction factor,fortran counts from 1 !
ccf= cloud_correction_factor(nint(abs(dlat))+1)

select case(method)
case(CLARK)
case(FILE)
select case(type)
case(1)
ql=qlobs
case(2)
ql = qlobs-bolz*emiss*(tw**4)
end select
case(CLARK)
! Clark et al. (1974) formula.
! unit of ea is Pascal, must hPa
! Black body defect term, clouds, water vapor correction
Expand Down
10 changes: 9 additions & 1 deletion src/fabm/gotm_fabm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ module gotm_fabm
bioshade_feedback,bioalbedo_feedback,biodrag_feedback, &
freshwater_impact,salinity_relaxation_to_freshwater_flux, &
save_inputs, no_surface



! Arrays for work, vertical movement, and cross-boundary fluxes
REALTYPE,allocatable,dimension(:,:) :: ws
Expand Down Expand Up @@ -250,7 +252,7 @@ subroutine configure_gotm_fabm(cfg)
!
! !INPUT PARAMETERS:
class (type_settings), intent(inout) :: cfg
type (type_settings), pointer :: branch
type (type_settings), pointer :: branch, twig
!
! !REVISION HISTORY:
! Original author(s): Jorn Bruggeman
Expand All @@ -266,6 +268,7 @@ subroutine configure_gotm_fabm(cfg)
! Initialize all namelist variables to reasonable default values.
call cfg%get(fabm_calc, 'use', 'enable FABM', &
default=.false.)

call cfg%get(freshwater_impact, 'freshwater_impact', 'enable dilution/concentration by precipitation/evaporation', &
default=.true.) ! disable to check mass conservation
branch => cfg%get_child('feedbacks', 'feedbacks to physics')
Expand All @@ -277,6 +280,7 @@ subroutine configure_gotm_fabm(cfg)
default=.false.)
call cfg%get(repair_state, 'repair_state', 'clip state to minimum/maximum boundaries', &
default=.false.)

branch => cfg%get_child('numerics', display=display_advanced)
call branch%get(ode_method, 'ode_method', 'time integration scheme applied to source terms', &
options=(/ option(1, 'Forward Euler', 'FE'), option(2, 'Runge-Kutta 2', 'RK2'), option(3, 'Runge-Kutta 4', 'RK4'), &
Expand Down Expand Up @@ -306,6 +310,8 @@ subroutine configure_gotm_fabm(cfg)
options=(/option(-1, 'auto-detect (prefer fabm.yaml)', 'auto'), option(0, 'fabm.nml', 'nml'), option(1, 'fabm.yaml', 'yaml')/), &
default=-1, display=display_advanced)



LEVEL2 'done.'

end subroutine configure_gotm_fabm
Expand Down Expand Up @@ -699,6 +705,8 @@ subroutine init_var_gotm_fabm(nlev)
! and link it to FABM.
decimal_yearday = _ZERO_
call model%link_scalar(standard_variables%number_of_days_since_start_of_the_year,decimal_yearday)
call model%link_scalar(standard_variables%timestep,dt) !jpnote added


allocate(Qsour(0:nlev),stat=rc)
if (rc /= 0) stop 'init_var_gotm_fabm(): Error allocating (Qsour)'
Expand Down
Loading