Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
382ae11
Adding preliminary example to couple with FABM
plazzari Aug 25, 2025
ef9d147
Add leonardo.intel
Marco-Puglia Oct 14, 2025
a9997e0
adding include and library paths for FABM
Nov 10, 2025
527c0d8
first test including fabm module
Nov 10, 2025
ca4c381
start including initialization phase of fabm in ogstm
Nov 11, 2025
7ca4acd
Adding Initialize and fabm.yaml read procedure
Nov 11, 2025
8200b62
bug fix
Nov 11, 2025
305746b
Bug fix, put linking of fabm library in the correct order, to fulfill…
Nov 20, 2025
d3c082b
add configuration file fabm.yaml to the FABM
Nov 20, 2025
59bfdd2
change name of lidata add suffix _ogstm to avoid conflict with fabm
Nov 25, 2025
27516d5
correct string for FABM path
Dec 3, 2025
7ab2f23
add the range of all bio-optical parameters
Dec 3, 2025
dd03573
include separate subroutines for native bfm and fabm
Dec 5, 2025
21949b7
select coupling with fabm
Dec 5, 2025
9d312a0
added more initialization functions, the creation of the model is cur…
Dec 5, 2025
f653e57
include switch between bfm old style and fabm
Jan 15, 2026
52c2e15
remove bfm code when bfm not active
Jan 15, 2026
f41ed18
Make ogstm agnostic with respect to biogeochemical model used, remove…
Jan 16, 2026
fcec602
finalize previuos commit: Make ogstm agnostic with respect to biogeo…
Jan 16, 2026
8771f2a
add test namelists for different BGC-TYPE
Jan 20, 2026
dea3972
add configuration column for BGC-TYPE
Jan 20, 2026
981b6af
Allows the model to use non parameter definition of BGC matrix sizes
Jan 20, 2026
b579ffd
Retrive size of passive tracers matrixes from FABM
Jan 21, 2026
b0858e6
Finalize to pass FABM internal variables names and units to OGSTM, na…
Jan 21, 2026
72f7e8e
set no BGC as Default configuration
Jan 21, 2026
4455762
Fix BFM and DEFAULT compilation in parini.f90
Jan 22, 2026
665fbbc
copy all the namelist need .optics and .phys when using fabm BGC_TYPE
Jan 26, 2026
a55726d
correct not ifdef with propoer syntax
Jan 26, 2026
c4309e3
allow for greater lenght of restart filenames and variables specific…
Jan 26, 2026
e8eb10a
include variable naming of FABM-BFM
Jan 27, 2026
9dd5086
hardcode relaxation variables --> need to be implemented better to ad…
Jan 27, 2026
fe50a20
adding module to read ogstm.yaml file, to configure I/O activation an…
Feb 4, 2026
1abda78
include cmake options to include yaml modules
Feb 4, 2026
2c1a09f
connect configuration parameter in ogstm.yaml for I/O to operating on…
Feb 4, 2026
3c3a6c5
add yaml directives to CMAKE
Feb 4, 2026
9d80458
set to default no BFM no FABM
Feb 4, 2026
cbb9065
exclude use of yaml module in default and BFM configurations
Feb 5, 2026
62611ea
add controls on ogstm.yaml declaration of tracer, need to be consiste…
Feb 5, 2026
341ada7
script to create template of ogstm.yaml
Feb 5, 2026
6bbae61
fix path and deployment for ogstm.yaml
Feb 10, 2026
d89362d
define seconds_per_time_unit to prevent error in FABM initialization
Feb 11, 2026
7796582
Dump info about restart files read.
Feb 12, 2026
c0909e0
Start including the environmental dependencies required by FABM.
Feb 12, 2026
8d8a59f
set always at least one HF output otherwise create problems all outpu…
Feb 12, 2026
09292d9
Bug fix on double declared variable.
Feb 12, 2026
be6ca69
Finalize the definition of FABM dependencies.
Feb 16, 2026
4f4b51d
Improve ogstm.yaml handling in deploy_code.py
plazzari Feb 19, 2026
a98de3e
Include instructions to apply derivatives from FABM
Feb 19, 2026
57ffbf4
adding mask for terrain points
Feb 23, 2026
81631bc
initialized aksi short wave radiation, huge values gives overflow nee…
Mar 2, 2026
cc187dd
initialized diagnostic to zero to prevent overflow, need to put corre…
Mar 2, 2026
02583ce
adding diagnostic data from FABM to OGSTM
Mar 2, 2026
2b19836
Adding sinking velocity taking the velocity from FABM, all variables …
Mar 3, 2026
f1cde3c
adding time variable, need to be fixed
Mar 4, 2026
2f7f73c
passing time parameters to FABM
Mar 4, 2026
2986ff1
added new function for day of the year
Mar 6, 2026
3f95613
pass to FABM the correct time informations
Mar 6, 2026
01ec572
from bfm to bgc flag activation
Mar 6, 2026
7ef22da
add target and pointer definitions
Mar 6, 2026
9e19045
setting diagnostic write default to -> false
Mar 6, 2026
44db032
add momentary write
Mar 11, 2026
e660ddc
graphic interface to configure ogstm.yaml
Mar 11, 2026
443006f
Adding trcave alternative subroutine for FABM
Mar 24, 2026
97e1a77
deactivaded recovery of diagnostics from restart in FABM
Mar 24, 2026
d49ec83
added improved diagnostic allocation according to what is dumped by u…
Mar 24, 2026
8b1b078
ogstm.yaml creation with graphic interface
Mar 24, 2026
2a725a3
added a missing space in the cp yaml instruction
Mar 26, 2026
513ee14
switched from the now absent lbfm flag to the new lbgc flag in all th…
Mar 26, 2026
08997ef
revert to previous version because the change was useless
Mar 26, 2026
de7ba4c
changed #ifndef to #ifdef to fix the bfm 'zero matrix output' runs
Mar 30, 2026
fc03e83
correct unit of measure and direction for sinking velocities, FABM p…
Mar 30, 2026
3b69d9b
Add RosenMacartur model setup
Apr 7, 2026
1ab4552
Add case for RosenMacartur mode
Apr 7, 2026
4a375ed
Add GUI for ogstm.yaml file configuration
Apr 7, 2026
35fe76f
extension of variable name strings for output files to 200 digits, bu…
Apr 15, 2026
c96f0cb
bug fix for function DAY_OF_THE_YEAR
Apr 15, 2026
176b4e6
added different options for var_nc definition of Restoration Mask, th…
Apr 15, 2026
ffb9094
Removed write for debug phase
Apr 15, 2026
6b81ae6
set aerosol_air_mass_type from 10 - continental - to 1 - open ocean -
Apr 15, 2026
c426151
Fixed error message to include the new FABM-BFM flag.
Apr 16, 2026
604342d
Select activation of ogstm OASIM model according to FABM.yaml file
Apr 16, 2026
23ee2e1
adding automatic selction of atmospheric model from fabm version or B…
Apr 17, 2026
c628521
Create init files for BFM98
plazzari Apr 21, 2026
dcdf3aa
script to generate vertical profiles for BFM98
plazzari Apr 22, 2026
39ea735
Added the mapping dictionary creator
Apr 23, 2026
e6e2d2f
code cleaning
plazzari Apr 23, 2026
9ebd327
code cleaning
plazzari Apr 23, 2026
e6465d9
Added bgc_error.py to house shared error logic and edited the relativ…
Apr 24, 2026
b8c266e
Bug fix on buondary conditions index i->j
Apr 28, 2026
dccf89a
update python script with BFM98
plazzari Apr 28, 2026
e82aa69
correct error message
plazzari Apr 28, 2026
afbdf03
Merge remote-tracking branch 'refs/remotes/origin/17-integration-with…
Apr 28, 2026
fd21758
new create_RESTARTS98.py file
May 13, 2026
2694e28
utility to create boundary conditions namelists with ogstm-fabm
May 15, 2026
c212dbb
refine utility to create boundary conditions namelists with ogstm-fabm
May 15, 2026
2478402
new create_ATL98.py file
May 15, 2026
985582b
Update create_ATL98.py
Marco-Puglia May 18, 2026
d81ec1f
Bug Fix for Parallel I/O when CPU per node > 99, more than two digit …
May 18, 2026
d5f29ff
Script to create 1.aveTimes type files
May 26, 2026
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
10 changes: 7 additions & 3 deletions GeneralCmake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ enable_language(Fortran C)
set (NETCDF_F90 "YES")
find_package(MPI REQUIRED)
find_package(NetCDF REQUIRED)
find_package(BFM REQUIRED)
#find_package(BFM REQUIRED)
#find_package(FABM REQUIRED)
#find_package(YAML REQUIRED)
find_package(BIOPTIMOD_3STREAM REQUIRED)
find_package(OASIM_ATM)

Expand Down Expand Up @@ -52,7 +54,9 @@ else ()
endif ()

#include
include_directories(${BFM_INCLUDES})
#include_directories(${BFM_INCLUDES})
#include_directories(${FABM_INCLUDES})
#include_directories(${YAML_INCLUDES})
include_directories(${BIOPTIMOD_3STREAM_INCLUDES})
include_directories(${OASIM_ATM_INCLUDES})
include_directories(${NETCDF_INCLUDES_C})
Expand All @@ -68,4 +72,4 @@ endforeach()
#building
add_library( ogstm_lib ${FORTRAN_SOURCES})
add_executable (ogstm.xx application/ogstm_main_caller.f90)
target_link_libraries( ogstm.xx ogstm_lib ${NETCDFF_LIBRARIES_F90} ${BFM_LIBRARIES} ${BIOPTIMOD_3STREAM_LIBRARIES} ${OASIM_ATM_LIBRARIES} )
target_link_libraries( ogstm.xx ogstm_lib ${NETCDFF_LIBRARIES_F90} ${BFM_LIBRARIES} ${FABM_LIBRARIES} ${BIOPTIMOD_3STREAM_LIBRARIES} ${OASIM_ATM_LIBRARIES} )
23 changes: 23 additions & 0 deletions cmake/FindFABM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# - Find FABM
# Find FABM package


find_library( FABM_LIBRARIES NAMES fabm libfabm HINTS $ENV{FABM_LIBRARY} )
message(STATUS "FABM library = ${FABM_LIBRARIES} ")
if (NOT "$ENV{FABM_LIBRARY}" STREQUAL "")
set(EnvironmentVariableName "$ENV{FABM_LIBRARY}" CACHE INTERNAL "Copied from environment variable")
endif()

message("EnvironmentVariableName = ${EnvironmentVariableName}")
if (FABM_LIBRARIES)
find_path (FABM_INCLUDES NAMES fabm.h HINTS $ENV{FABM_INCLUDE} NO_DEFAULT_PATH)
add_definitions(-Dkey_trc_fabm -Dkey_INCLUDE_FABM_PELCO2)
message(STATUS "FABM include = ${FABM_INCLUDES} ")
set (FABM_has_interfaces "YES")
else (FABM_LIBRARIES)
set (FABM_has_interfaces "NO")
endif (FABM_LIBRARIES)

include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (FABM DEFAULT_MSG FABM_has_interfaces)
mark_as_advanced (FABM_LIBRARIES FABM_INCLUDES)
13 changes: 13 additions & 0 deletions cmake/FindYAML.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# - Find FABM
# Find FABM package


message("EnvironmentVariableName = ${EnvironmentVariableName}")
find_path (YAML_INCLUDES NAMES yaml.mod yaml_settings.mod yaml_types.mod HINTS $ENV{YAML_INCLUDE} NO_DEFAULT_PATH)
add_definitions(-Dkey_yaml )
message(STATUS "YAML include = ${YAML_INCLUDES} ")
set (FABM_has_interfaces "YES")

include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (YAML DEFAULT_MSG FABM_has_interfaces)
mark_as_advanced (YAML_INCLUDES)
15 changes: 15 additions & 0 deletions compilers/machine_modules/leonardo.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module load intel-oneapi-compilers/2023.2.1
module load netcdf-fortran/4.6.1--intel-oneapi-mpi--2021.12.1--oneapi--2024.1.0
module load gsl/2.7.1--oneapi--2023.2.0

export CC=icx
export NETCDF_CFLAGS=$(nc-config --cflags)
export NETCDF_CLIBS=$(nc-config --libs)
export NETCDF_LIB=$(nc-config --libdir)
export NETCDF_INC=$(nc-config --includedir)

export FC=ifort
export NETCDF_FFLAGS=$(nf-config --fflags)
export NETCDF_FLIBS=$(nf-config --flibs)
export NETCDFF_LIB=$(nf-config --prefix)/lib
export NETCDFF_INC=$(nf-config --includedir)
4 changes: 2 additions & 2 deletions compilers/x86_64.LINUX.intel.dbg.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
MPILIB= -L $(MPI_LIB)/lib -lmpi_f90
# F Flags
FFLAGS_DBG= -O0 -g -traceback -fp-stack-check -check bounds -fpe0
FFLAGS= $(FFLAGS_DBG) -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include -I$(BFM_INC) -extend_source
LDFLAGS= -L $(NETCDF_LIB) -lnetcdff -lnetcdf -L$(BFM_LIB) -lbfm
FFLAGS= $(FFLAGS_DBG) -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include -I$(BFM_INC) -I$(FABM_INC) -extend_source
LDFLAGS= -L $(NETCDF_LIB) -lnetcdff -lnetcdf -L$(BFM_LIB) -lbfm -L$(FABM_LIB) -lfabm
# C Flags
CFLAGS_DBG=
CFLAGS= ${CFLAGS_DBG} -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include
4 changes: 2 additions & 2 deletions compilers/x86_64.LINUX.intel.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# F Flags
MPILIB= -L $(MPI_LIB)/lib -lmpi_f90
FFLAGS_OPT= -fno-math-errno -unroll=3 -opt-subscript-in-range -align all -cpp -heap-arrays
FFLAGS= $(FFLAGS_OPT) -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include -I$(BFM_INC) -extend_source
LDFLAGS= -L $(NETCDF_LIB) -lnetcdff -lnetcdf -L $(BFM_LIB) -lbfm
FFLAGS= $(FFLAGS_OPT) -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include -I$(BFM_INC) -I$(FABM_INC) -extend_source
LDFLAGS= -L $(NETCDF_LIB) -lnetcdff -lnetcdf -L $(BFM_LIB) -lbfm -L $(FABM_LIB) -lfabm
# C Flags
CFLAGS_DBG=
CFLAGS= ${CFLAGS_DBG} -I$(NETCDF_INC) -I$(OPENMPI_HOME)/include
6 changes: 3 additions & 3 deletions src/BC/closed.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module closed_mod
! TO DO: review names
character(len=3) :: m_name ! ex: 'gib'
integer :: m_n_vars ! BC_mem.f90:94
character(len=20), allocatable, dimension(:) :: m_var_names ! domrea.f90:161-167
character(len=20), allocatable, dimension(:) :: m_var_names_data ! bc_gib.f90:113
character(len=200), allocatable, dimension(:) :: m_var_names ! domrea.f90:161-167
character(len=200), allocatable, dimension(:) :: m_var_names_data ! bc_gib.f90:113
integer(4), allocatable, dimension(:) :: m_var_names_idx ! tra_matrix_gib
double precision, allocatable, dimension(:, :, :) :: m_buffer ! replaces m_aux, now it is a 3D matrix
integer(4) :: m_size ! BC_mem.f90:21
Expand Down Expand Up @@ -146,7 +146,7 @@ subroutine init_members(self, bc_name, namelist_file)
character(len=7), intent(in) :: namelist_file

integer :: n_vars
character(len=20), allocatable, dimension(:) :: vars
character(len=200), allocatable, dimension(:) :: vars
integer(4), allocatable, dimension(:) :: var_names_idx
double precision :: alpha
double precision :: reduction_value_t
Expand Down
8 changes: 4 additions & 4 deletions src/BC/hard_open.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module hard_open_mod

character(len=3) :: m_name ! ex: 'ope'
integer :: m_n_vars
character(len=20), allocatable, dimension(:) :: m_var_names
character(len=20), allocatable, dimension(:) :: m_var_names_data
character(len=200), allocatable, dimension(:) :: m_var_names
character(len=200), allocatable, dimension(:) :: m_var_names_data
integer(4), allocatable, dimension(:) :: m_var_names_idx
integer :: m_n_missing_vars
integer(4), allocatable, dimension(:) :: m_missing_var_names_idx
Expand Down Expand Up @@ -228,7 +228,7 @@ subroutine init_members(self, bc_name, namelist_file, n_tracers)
integer, intent(in) :: n_tracers

integer :: n_vars
character(len=20), allocatable, dimension(:) :: vars
character(len=200), allocatable, dimension(:) :: vars
integer(4) :: geometry
double precision :: damping_coeff
integer, parameter :: file_unit = 101 ! 100 for data files, 101 for boundary namelist files
Expand Down Expand Up @@ -544,7 +544,7 @@ subroutine apply_dirichlet(self)
! 2nd loop: provided variables on neighbors
do j = 1, self%m_size

idx_i = self%m_neighbors(1, i)
idx_i = self%m_neighbors(1, j)
idx_j = self%m_neighbors(2, j)
idx_k = self%m_neighbors(3, j)

Expand Down
6 changes: 3 additions & 3 deletions src/BC/nudging.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ module nudging_mod
class(bc), pointer :: m_bc_no_nudging => null()
character(len=11) :: m_data_file ! 11 chars in order to handle names like 'bounmask.nc'
integer :: m_n_nudging_vars
character(len=20), allocatable, dimension(:) :: m_nudging_vars
character(len=20), allocatable, dimension(:) :: m_nudging_vars_rst
character(len=200), allocatable, dimension(:) :: m_nudging_vars
character(len=200), allocatable, dimension(:) :: m_nudging_vars_rst
integer(4), allocatable, dimension(:) :: m_nudging_vars_idx ! tra_matrix_gib
double precision, allocatable, dimension(:, :, :, :) :: m_rst ! resto
double precision, allocatable, dimension(:) :: m_rst_corr ! restocorr
Expand Down Expand Up @@ -79,7 +79,7 @@ subroutine init_members(self, bc_no_nudging, namelist_file, n_tracers)

integer :: n_vars
character(len=11) :: data_file ! 11 chars in order to handle names like 'bounmask.nc'
character(len=20), allocatable, dimension(:) :: vars
character(len=200), allocatable, dimension(:) :: vars
double precision, allocatable, dimension(:) :: rst_corr
integer, parameter :: file_unit = 101 ! 100 for data files, 101 for boundary namelist files

Expand Down
6 changes: 3 additions & 3 deletions src/BC/rivers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module rivers_mod
! TO DO: review names
character(len=3) :: m_name ! ex: 'riv'
integer :: m_n_vars ! BC_mem.f90:95
character(len=20), allocatable, dimension(:) :: m_var_names
character(len=20), allocatable, dimension(:) :: m_var_names_data ! bc_tin.f90:116
character(len=200), allocatable, dimension(:) :: m_var_names
character(len=200), allocatable, dimension(:) :: m_var_names_data ! bc_tin.f90:116
integer(4), allocatable, dimension(:) :: m_var_names_idx ! tra_matrix_riv
double precision, allocatable, dimension(:, :) :: m_buffer ! replaces m_aux, now it is a 2D matrix
integer(4) :: m_size
Expand Down Expand Up @@ -139,7 +139,7 @@ subroutine init_members(self, bc_name, namelist_file)
character(len=7), intent(in) :: namelist_file

integer :: n_vars
character(len=20), allocatable, dimension(:) :: vars
character(len=200), allocatable, dimension(:) :: vars
integer, parameter :: file_unit = 101 ! 100 for data files, 101 for boundary namelist files
integer :: i
namelist /vars_dimension/ n_vars
Expand Down
6 changes: 3 additions & 3 deletions src/BC/sponge.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module sponge_mod
! TO DO: review names
character(len=3) :: m_name ! ex: 'gib'
integer :: m_n_vars ! BC_mem.f90:94
character(len=20), allocatable, dimension(:) :: m_var_names ! domrea.f90:161-167
character(len=20), allocatable, dimension(:) :: m_var_names_data ! bc_gib.f90:113
character(len=200), allocatable, dimension(:) :: m_var_names ! domrea.f90:161-167
character(len=200), allocatable, dimension(:) :: m_var_names_data ! bc_gib.f90:113
integer(4), allocatable, dimension(:) :: m_var_names_idx ! tra_matrix_gib
double precision, allocatable, dimension(:, :, :) :: m_buffer ! replaces m_aux, now it is a 3D matrix
integer(4) :: m_size ! BC_mem.f90:21
Expand Down Expand Up @@ -149,7 +149,7 @@ subroutine init_members(self, bc_name, namelist_file)
character(len=7), intent(in) :: namelist_file

integer :: n_vars
character(len=20), allocatable, dimension(:) :: vars
character(len=200), allocatable, dimension(:) :: vars
double precision :: alpha
double precision :: reduction_value_t
double precision :: length
Expand Down
67 changes: 50 additions & 17 deletions src/BIO-OPTICS/OPT_mem.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MODULE OPT_mem

public


LOGICAL :: oasim_bioptimod=.FALSE., oasim_fabm=.FALSE.
INTEGER, allocatable :: itabe(:),imaske(:,:)
double precision, allocatable :: zpar(:,:),xEPS_ogstm(:,:)
double precision, allocatable :: zpar0m(:),zpar100(:)
Expand All @@ -34,19 +34,27 @@ MODULE OPT_mem
double precision, allocatable :: asympIO(:,:,:,:)
double precision, allocatable :: ssalbIO(:,:,:,:)

double precision, allocatable :: sp(:,:)
double precision, allocatable :: msl(:,:)
double precision, allocatable :: t2m(:,:)
double precision, allocatable :: d2m(:,:)
double precision, allocatable :: tcc(:,:)
double precision, allocatable :: w10(:,:)
double precision, allocatable :: tclw(:,:)
double precision, allocatable :: tco3(:,:)
double precision, allocatable :: cdrem(:,:)
double precision, allocatable :: cldtcm(:,:)
double precision, allocatable :: taua(:,:,:)
double precision, allocatable :: asymp(:,:,:)
double precision, allocatable :: ssalb(:,:,:)
double precision, allocatable,target :: sp(:,:)
double precision, allocatable,target :: msl(:,:)
double precision, allocatable,target :: t2m(:,:)
double precision, allocatable,target :: d2m(:,:)
double precision, allocatable,target :: tcc(:,:)
double precision, allocatable,target :: w10(:,:)
double precision, allocatable,target :: tclw(:,:)
double precision, allocatable,target :: tco3(:,:)
double precision, allocatable,target :: cdrem(:,:)
double precision, allocatable,target :: cldtcm(:,:)
double precision, allocatable,target :: taua(:,:,:)
double precision, allocatable,target :: asymp(:,:,:)
double precision, allocatable,target :: ssalb(:,:,:)
! FABM optical model variables
double precision, target :: yearday
double precision, allocatable, target :: surface_downwelling_shortwave_flux(:,:)
double precision, allocatable, target :: atmosphere_mass_content_of_water_vapor(:,:)
double precision, allocatable, target :: visibility_in_air(:,:)
double precision, allocatable, target :: aerosol_air_mass_type(:,:)
double precision, allocatable, target :: surface_specific_humidity(:,:)

! ############
real, allocatable :: zkef_f (:,:)
CHARACTER(LEN=7), allocatable,dimension(:) :: Ednm, Esnm, Eunm
Expand All @@ -63,11 +71,17 @@ MODULE OPT_mem
integer, parameter :: nlt=33
integer :: lam(33)
double precision :: WtoQ(33)
! Wavelength strings with 4-digit zero padding
CHARACTER(LEN=4), parameter :: lam_strings(33) = (/ &
'0250', '0325', '0350', '0375', '0400', '0425', '0450', '0475', '0500', '0525', &
'0550', '0575', '0600', '0625', '0650', '0675', '0700', '0725', '0775', '0850', &
'0950', '1050', '1150', '1250', '1350', '1450', '1550', '1650', '1750', '1900', &
'2200', '2900', '3700' /)
! Radiative transfer model parameter OASIM Native coordinates
double precision :: Ed_0m_COARSE(33,12,18,48), Es_0m_COARSE(33,12,18,48) ! lon, lat, day period, wave length
double precision :: OASIM_lon(18,48), OASIM_lat(18,48)
! Radiative transfer model parameter OGSTM coordinates
double precision,allocatable :: Ed_0m(:,:,:), Es_0m(:,:,:) ! wav, lat, lon
double precision,target,allocatable :: Ed_0m(:,:,:), Es_0m(:,:,:) ! wav, lat, lon

INTEGER :: day_RTcheck
! in-water model
Expand Down Expand Up @@ -155,7 +169,10 @@ subroutine myalloc_OPT()
! kef = huge(kef(1,1))
! allocate(kextIO(jpj,jpi,2))
! kextIO = huge(kextIO(1,1,1))

#ifdef key_trc_bfm
oasim_bioptimod=.TRUE.
write(numout,*) 'OASIM optical model will be used'
#endif
allocate(sp (jpj,jpi)) ; sp =huge(sp(1,1))
allocate(msl(jpj,jpi)) ; msl=huge(sp(1,1))
allocate(t2m(jpj,jpi)) ; t2m=huge(sp(1,1))
Expand All @@ -169,6 +186,22 @@ subroutine myalloc_OPT()
allocate(taua(33,jpj,jpi)) ; taua=huge(sp(1,1))
allocate(asymp(33,jpj,jpi)); asymp=huge(sp(1,1))
allocate(ssalb(33,jpj,jpi)); ssalb=huge(sp(1,1))
! FABM optical model variables
allocate(surface_downwelling_shortwave_flux(jpj,jpi))
surface_downwelling_shortwave_flux=huge(surface_downwelling_shortwave_flux(1,1))

allocate(atmosphere_mass_content_of_water_vapor(jpj,jpi))
atmosphere_mass_content_of_water_vapor=huge(atmosphere_mass_content_of_water_vapor(1,1))

allocate(visibility_in_air(jpj,jpi))
visibility_in_air=huge(visibility_in_air(1,1))

allocate(aerosol_air_mass_type(jpj,jpi))
aerosol_air_mass_type=huge(surface_specific_humidity(1,1))

allocate(surface_specific_humidity(jpj,jpi))
surface_specific_humidity=huge(surface_specific_humidity(1,1))


allocate(spIO (jpj,jpi,2)) ; spIO =huge(sp(1,1))
allocate(mslIO(jpj,jpi,2)) ; mslIO =huge(sp(1,1))
Expand Down Expand Up @@ -207,7 +240,7 @@ subroutine myalloc_OPT()
allocate(ea(jpj,jpi,3))
ea =huge(ea(1,1,1))

call lidata()
call lidata_ogstm()

allocate(Edaux(nlt))
allocate(Esaux(nlt))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
subroutine lidata()
! subroutine lidata(lam,aw,bw,ac,bc)
subroutine lidata_ogstm()

USE OPT_mem, ONLY: nlt, nchl, lam,aw,bw,ac,ac_ps,bc,bbc,apoc,bpoc,bbpoc,acdom
USE myalloc, only: lwp,numout
Expand Down
4 changes: 4 additions & 0 deletions src/BIO-OPTICS/oasim_caller.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ subroutine OASIM_CALLER(datestring)

use myalloc
use OPT_mem
use BIO_mem
use TIME_MANAGER
use mpi
use oasim, only: calc_unit, oasim_lib
Expand Down Expand Up @@ -39,6 +40,8 @@ subroutine OASIM_CALLER(datestring)
CALL forcings_atm_clim(datestring)
CALL forcings_atm_aero(datestring)

if (oasim_bioptimod) then

counter=1
do ji=1,jpi
do jj=1,jpj
Expand Down Expand Up @@ -87,6 +90,7 @@ subroutine OASIM_CALLER(datestring)

call trc3streams(datestring) ! 3-stream radiative model

end if ! oasim_bioptimod

trcoptparttime = MPI_WTIME() - trcoptparttime ! cronometer-stop
trcopttottime = trcopttottime + trcoptparttime
Expand Down
2 changes: 1 addition & 1 deletion src/BIO-OPTICS/trc3streams.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SUBROUTINE trc3streams(datestring)
INTEGER :: MODE ! 0-exact, 1-approx
INTEGER :: year, month, day, ihr
INTEGER :: it_actual
CHARACTER(LEN=20) :: V_POSITION
CHARACTER(LEN=200) :: V_POSITION
double precision :: solz(jpj,jpi), rmud(jpj,jpi)
double precision :: Edz(jpk,nlt),Esz(jpk,nlt),Euz(jpk,nlt)
double precision, allocatable:: E(:,:,:) !(3,jpk+1,nlt)
Expand Down
Loading