Commit d6594dfd authored by Jérémy Baudry's avatar Jérémy Baudry

new version

parents
----------------------------------------------------
Welcome to the Phytoplankton Lagrangian Model 2014!
----------------------------------------------------
The model has been designed to be very user-friendly, however some modifications
must be done to fit with your machine.
So, please read the following steps to correctly start the model.
1) COMPILATION:
-Ensure first that gfortran is installed on your machine.
-Ensure that the NETCDF FORTRAN libraries are installed on your machine.
-Change the path for the NETCDF FORTRAN module and libraries in the makefile
-compile the source codes using the command «make». The executable will be
created in the parent directory.
- you can also delete all object file and the executable by using the command «make mrproper»
2) USE THE MODEL
- The model use namelists in nml/ allowing to change some parameter values without recompiling
the source code
- outputs will be generated in the directory output/
3) USE THE MODEL WITH GOTM
- The model can call GOTM to produce a diffusivity profile. If you want to use this feature
you have to change the value of the parameter «mix_state» in the namelist model_parameter
- Before doing this, ensure that GOTM is installed on your machine and copy all the GOTM namelists
you need in the directory gotm/. You should also create a symbolic link of the executable in the
directory gotm/
4) USE BATCH MODE
- you can also run the model in batch mode. To do this, you must change the file
batch_bio_pbs.sh
have fun
for question, please contact me at baudryjeremy@gmail.com
!-----------------------------------------------------------------------------------------------
! bio_calc : Do biological calculations
0: No biological calculation
1: biological growth
! bio_model : Model for phytoplankton growth
! 1: Monod equations
! 2: Droop equations
!
! mu_max : max growth rate for Droop equations (bio_model=2) [s-1]
! q0 : internal nutrient subsistence quota (for bio_model=2) [mol N/mol C]
! mortality : mortality rate [s-1]
! Kn : Half saturation constant [mol N/m3]
! Vmax : maximum nutrient uptake rate [molP/molC/s-1]
! Nutrient_0 : Initial Nutrient concentration [mol N/m3]
! w_s : Plankton settling velocity [m/s]
! part_management : algorithm management number particles
! mu_r : Respiration rate constant [s-1]
! kw : Nutrient excretion rate constant [s-1]
! q_max : internal nutrient maximum storage quota [mol N/mol C]
! m0 : biomass per cell [mol C]
!-----------------------------------------------------------------------------------------------
&bio_parameter_nml
bio_calc = 1
bio_model = 2
mu_max = mubatch
q0 = 5e-02
mortality = 0
Kn = 0.214e-03
Vmax = vmaxbatch
Nutrient_0 = nutbatch
w_s = 0
part_management = 1
mu_r = 1.1574e-06
kw = 0
q_max = 0.25
m0 = 1e-12
/
#!/bin/bash
#-------------------depth------------------------------------
diffu="1e-6 1e-4 1e-3 1e-2"
name_exp=('1depth10' '1depth20' '1depth100' '1depth200'
'2depth10' '2depth20' '2depth100' '2depth200'
'3depth10' '3depth20' '3depth100' '3depth200'
'4depth10' '4depth20' '4depth100' '4depth200')
let "count1=0"
let "count2=0"
for b in $diffu
do
prof="10 20 100 200"
let "count=0"
for a in $prof
do
cat batch_bio_parameter.txt | sed \
-e "s/mubatch/2.3148e-5/g" \
-e "s/vmaxbatch/9.3870e-6/g" \
-e "s/nutbatch/5e-3/g" \
> bio_parameter.nml
mv bio_parameter.nml ../nml/
cat batch_model_parameter.txt | sed \
-e "s/depthbatch/$a/g" \
-e "s/nme/${name_exp[$count2]}/g" \
-e "s/diffbatch/$b/g" \
> model_parameter.nml
mv model_parameter.nml ../nml/
qsub ./lanceurpbs.sh
sleep 5s
let "count=count+1"
let "count2=count2+1"
done
let "count1=count1+1"
done
sleep 3h
!------------------------------------------------------------------------------------------
! General model Parameters
!
! name_exp : Name of the simulation
! depth : Depth of the water column [m]
! dz : Resolution of the grid [m]
! K_value : Value of diffusivity for the uniform case [m2/s]
! time_step : time step of the simulation [s]
! ndays : Number of days of the simulation [-]
! output_time : write to file each output_time step [-]
!
! mix_state : choice for the diffusivity profile
! -> 1 uniform profil, the value of the diffusivity
! is given by K_value
! -> 2 non-uniform profil, diffusivity calculated from GOTM
!
!
! particle_distribution : choice for the initial distribution of the particles
! -> 1 release all particles in a particular depth defined by z_0
! -> 2 release the particles uniformely in the domain
!
! nbpart : Number of particles generated [-]
! z_0 : depth where particles are released
! (if particles_distribution=1) [m]
! day_length : length of the day [h]
! rad_max :solar irradiance at the surface [ ]
! k_bg : light attenuation [m-1]
!
!
!
!------------------------------------------------------------------------------------------
&model_parameter_nml
name_exp ='nme'
depth = depthbatch
dz = 0.5
K_value = diffbatch
time_step = 60
ndays = 2
output_time = 2
mix_state = 1
particle_distribution = 2
nbpart = 5000
z_0 = 10
day_length = 16
rad_max = 600
k_bg = 0.4
/
#!/bin/bash
#PBS -q default
#PBS -l walltime=15:00:00
#PBS -l nodes=1:ppn=20
#PBS -l nice=19
#PBS -j oe
#PBS -N lagrangien
module load dot
hostname
cd $PBS_O_WORKDIR
export NPROCS=$(wc -l $PBS_NODEFILE | gawk '//{print $1}')
cd ..
(time -p ./LAGRANGIAN_MODEL_2014) |& tail -n3 | head -n1 | cut -c5- >>batch/time_sim.txt
!$Id: airsea.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
! air-sea interaction (heat, momentum and freshwater fluxes and solar radiation)
!
! calc_fluxes -> surface fluxes calculated by means of bulk formulae
! (.true./.false.). Solar radiation is calculated from
! time, latitude, longitude and clouds. If (.true.),
! meteo_file must be given and wet_mode must be specified.
! If (.false.), surface fluxes and solar radiation are
! prescribed.
!
! meteo_file -> file with meteo data (for calc_fluxes=.true.) with
! - date (yyyy-mm-dd hh:mm:ss)
! - x-comp. of wind (10 m) in m/s
! - y-comp. of wind (10 m) in m/s
! - air pressure ( 2 m) in hectopascal
! - dry air temp. ( 2 m) in Celsius
! - relative humidity in % or wet bulb temperature in C
! or dew point temperature in C (depending on wet_mode)
! - cloud cover in 1/10
!
! wet_mode -> decides what is given in 7. column in meteo_file
! 1: relative humidity
! 2: wet bulb temperature
! 3: dew point temperature
!
! heat_method -> method to provide short wave radiation (swr) and
! surface heat flux (qh)
! (only for calc_fluxes=.false.)
! 0: heat flux not prescribed
! 1: constant "const_swr" and "const_qh" given (see below)
! 2: swr and qh are read from heatflux_file
! const_swr -> constant value of incoming short wave radiation in W/m^2
! (always positive)
!
! const_qh -> constant value of surface heat flux in W/m^2
! (negative for heat loss)
!
! heatflux_file -> file with qin and qout given in W/m^2
! (negative for net outgoing)
!
! momentum_method -> method how momentum fluxes are given
! (only for calc_fluxes=.false.)
! 0: momentum flux not prescribed
! 1: constant surface momentum fluxes given
! 2: surface momentum fluxes given from file momentumflux_file
!
! const_tx -> x-component of surface momentum flux in N/m^2
! const_ty -> y-component of surface momentum flux in N/m^2
!
! momentumflux_file-> file with tx and ty given in N/m^2
!
! p_e_method -> method how fresh water fluxes (P-E) are given
! 0: P-E not used
! 1: constant value for P-E (in m/s) used
! (P-E = precipitation-evaporation)
! 2: values for P-E read from file
!
! const_p_e -> constant value for P-E in m/s (positive for P>E)
!
! p_e_flux_file -> file with value for P-E (positive for P>E)
! used if p_e_method=2
!
! sst_method -> method how sea surface temperature (SST) is given
! 0: no independent SST observation is read from file
! 2: independent SST observation is read from file,
! only for output
!
! sst_file -> file with independent SST observation
!
! sss_method -> method how sea surface salinity (SSS) is given
! 0: no independent SSS observation is read from file
! 2: independent SSS observation is read from file,
! only for output
!-------------------------------------------------------------------------------
&airsea
calc_fluxes= .true.
meteo_file= 'meteo.dat'
wet_mode= 1
heat_method= 0
const_swr= 100.0
const_heat= -100.0
heatflux_file= 'narr_heatflux_MY_100.dat'
momentum_method= 1
const_tx= 0.01
const_ty= 0.0
momentumflux_file='narr_momentumflux_MY_100.dat'
p_e_method= 0
const_p_e= 0.
p_e_flux_file= 'p_e.dat'
sst_method= 0
sst_file= 'sst.dat'
sss_method= 0
sss_file= 'sss.dat'
/
!$Id$
!-------------------------------------------------------------------------------
! Basic settings for biogeochemical model
!
! bio_calc -> calculation of the bio model 'bio_model' (.true./.false.)
! bio_model -> choice of the bio model:
! 1: NPZD (4 variables)
! 2: IOW-ERGOM (9 variables)
! 3: Suspended matter only (1 variable)
! 4: Fasham et al. 1990 (7 variables)
!
! bio_eulerian -> state variables are Eulerian (.true./.false.)
!
! cnpar -> Cranck-Nicolson parameter for vertical diffusion
!
! w_adv_discr -> advection scheme for vertical motion
! 1: first order upstream
! 2: not coded yet
! 3: third-order polynomial
! 4: TVD with Superbee limiter
! 5: TVD with MUSCL limiter
! 6: TVD with ULTIMATE QUICKEST
!
! ode_method -> ODE scheme for source and sink dynamics
! 1: first-order explicit (not positive)
! 2: second order explicit Runge-Kutta (not positive)
! 3: fourth-order explicit Runge-Kutta (not positive)
! 4: Patankar (first order, not conservative)
! 5: Patankar-RK (second order, not conservative)
! 6: Patankar-RK (does not work, not conservative)
! 7: Modified Patankar (1. order, conservat., posit.)
! 8: Modified Patankar-RK (2. order, conservat., posit.)
! 9: Modified Patankar-RK (does not work, conservat., posit.)
! 10: Ext. Modified Patankar (1. order, conservat., posit.)
! 11: Ext. Modified Patankar-RK (2. order, conservat., posit.)
!
! split_factor -> number of biogeochemical time steps per physical time step
!
! bioshade_feedback -> feedback of bio-turbidity to temp. eq. (.true./.false.)
!
! bio_lagrange_mean -> averaging Lagrangian conc. on output (.true./.false.)
!
! bio_npar -> total number of Lagrangian particles
!-------------------------------------------------------------------------------
&bio_nml
bio_calc= .false.
bio_model= 3
bio_eulerian= .false.
cnpar= 1.0
w_adv_discr= 6
ode_method= 8
split_factor= 1
bioshade_feedback= .true.
bio_lagrange_mean= .true.
bio_npar= 100000
/
clear all;
close all;
duration_sim=30;
time_step=1;
year=2008;
month=01;
first_day=1;
day=first_day;
hour=0;
minute=0;
sec=0;
fid = fopen('meteo.dat','w');
for i=1:(duration_sim*24)/time_step
hour=hour+1;
if (mod(i,24)==0)
day=day+1;
hour=0;
minute=0;
sec=0;
end
if (day>30)
month=month+1;
end
time=datenum(year,month,day,hour,minute,sec);
time=datestr(time,31);
windx=5;
windy=0;
pressure=1013;
temperature=15;
humidity=80;
cloud=0.5;
windx=num2str(windx);
windy=num2str(windy);
pressure=num2str(pressure);
humidity=num2str(humidity);
temperature=num2str(temperature);
cloud=num2str(cloud);
file=strcat(time,'\t',windx,'\t',windy,'\t',pressure,'\t',temperature,'\t',humidity,'\t',cloud,'\n');
fprintf(fid,file);
end
!$Id: gotmmean.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
! The namelists 'meanflow' is read in meanflow.F90.
!-------------------------------------------------------------------------------
!-------------------------------------------------------------------------------
! Specify variables related to the 1D meanflow model.
!
! h0b= bottom roughness - Note: z0b=0.03*h0b+0.1*nu/ustar [m]
! z0s_min= minimum value of z0s, default value if charnock=.false. [m]
! charnock= .true.: adaptation of Charnok 1955 formula used
! .false.: constant surface roughness length z0s_min used
! charnock_val= emp. constant in Charnok 1955 formula (default = 1400.)
! ddu= grid zooming (surface), 0: no zooming; > 3 strong zooming
! ddl= grid zooming (bottom), 0: no zooming; > 3 strong zooming
! grid_method= 0: zooming of grid with ddl, ddu >= 0
! 1: sigma grid (relative depth fractions) read from file
! 2: cartesian grid (fixed layer height in m) read from file
!
! grid_file= file for sigma or cartesian grid. the first line gives the
! number of layers, the following lines give fractions or
! layer heights in m from the surface down to the bottom.
! gravity= gravitational acceleration [m/s^2]
! rho_0= Reference density [kg/m^3].
! cp= Specific heat of sea water [J/kg/K].
! avmolu= molecular viscosity for momentum [m^2/s].
! avmolt= molecular diffusity for temperature [m^2/s].
! avmols= molecular diffusity for salinity [m^2/s].
! MaxItz0b= max # of iterations for z0b as function of u_taub.
! no_shear= .true.: shear production term P is set to zero
! avmoln= molecular diffusivity for nitrate [m^2/s]. !DD
!-------------------------------------------------------------------------------
&meanflow
h0b= 0.05
z0s_min= 0.02
charnock= .false.
charnock_val= 1400.
ddu= 0.
ddl= 0.
grid_method= 0
grid_file= 'grid.dat'
gravity= 9.81
rho_0= 1027.
cp= 3985.
avmolu= 1.3e-6
avmolt= 1.4e-7
avmols= 1.1e-9
MaxItz0b= 1
no_shear= .false.
/
!$Id: gotmrun.proto,v 1.1.1.1 2003/03/11 13:38:58 kbk Exp $
!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
! general model setup
!
! title -> title of simulation
! nlev -> number of levels
! dt -> time step in seconds
! cnpar -> parameter for "explicitness" of numerical scheme
! (between 0.0 and 1.0)
! buoy_method -> method to compute mean buoyancy
! 1: from equation of state
! (i.e. from potential temperature and salinity)
! 2: from prognostic equation
!
!-------------------------------------------------------------------------------
&model_setup
title= "LAGRANGIAN_TURB"
nlev= 50
dt= 1
buoy_method= 1
/
!-------------------------------------------------------------------------------
! geographic location
!
! name -> name of the station
! latitude -> latitude in degree (north is positive)
! longitude -> longitude in degree (east is positive)
! depth -> water depth in meters
!
!-------------------------------------------------------------------------------
&station
name= "amundsen gulf"
latitude= 71.5
longitude= -127.0
depth= 20
/
!-------------------------------------------------------------------------------
! duration of run
!
! timefmt -> method to specify start and duration of model run
! 1: duration computed from number of time steps, MaxN
! (bogus start date used)
! 3: duration computed from number of time steps, MaxN
! (start date as specified, stop date computed)
!
! MaxN -> nominal number of time steps (see "timefmt")
! start -> nominal start date: YYYY/MM/DD HH:MM:SS (see "timefmt")
! stop -> nominal stop date: YYYY/MM/DD HH:MM:SS (see "timefmt")
!
!-------------------------------------------------------------------------------
&time
timefmt= 2
MaxN= 200
start= '2008-01-01 00:00:00'
stop= '2008-01-21 00:00:00'
/
!-------------------------------------------------------------------------------
! format for output and filename(s).
!
! out_fmt -> format for GOTM output
! 1: ASCII
! 2: NetCDF
! 3: GrADS
!
! out_dir -> path to output directory (set permissions)
! out_fn -> output string used to generate output file names
! nsave -> save results every 'nsave' timesteps
! diagnostics -> diagnostics are written to output (if .true.)
!
! mld_method -> how to diagnose mixed layer depth
! 1: mixed layer depth computed from TKE threshold
! 2: mixed layer depth from Ri threshold
! diff_k -> TKE threshold [m^2/s^2] for mixed layer depth
! ri_crit -> Ri threshold for mixed layer depth
!
! rad_corr -> correct surface buoyancy flux for solar radiation
! for output (if true)
!
!-------------------------------------------------------------------------------
&output
out_fmt= 2
out_dir= "../input"
out_fn= "gotm_out"
nsave= 600
diagnostics= .false.
mld_method= 2
diff_k= 1.e-7
Ri_crit= 0.5
rad_corr= .true.
/
!-------------------------------------------------------------------------------
! Specify variables related to the equation of state.
!
! eq_state_mode -> choice for empirical formula for equation of state
! 1: UNESCO equation of state by Fofonoff and Millard (1983)
! 2: equation of state according Jackett et al. (2005)
!
! eq_state_method -> method to compute density and buoyancy from salinity,
! potential temperature and pressure
! 1: full equation of state (i.e. with the LOCAL
! pressure). This implies that T is NOT treated as
! the potential temperature but rather as the in-situ
! temperature!
! 2: equation of state with pressure evaluated at the surface.
! This implies that T is treated as the potential
! temperature and thus rho as the potential density.
! 3: linearized equation of state at T0,S0,p0
! (again, use p0=p_surf to work with potential
! temperature and density.)
! 4: linear equation of state with T0,S0,dtr0,dsr0
!
! For the precise definition of the following quantities, see
! GOTM documentation:
!
! T0 -> reference temperature (deg C) for linear equation of state
! S0 -> reference salinity (psu) for linear equation of state
! p0 -> reference pressure (bar) for linear equation of state
! dtr0 -> thermal expansion coefficient for linear equation of state
! dsr0 -> saline expansion coefficient for linear equation of state
!-------------------------------------------------------------------------------
&eqstate
eq_state_mode = 1
eq_state_method= 1
T0= 10.
S0= 35.
p0= 0.
dtr0= -0.17
dsr0= 0.78
/
This diff is collapsed.
!$Id$
!-------------------------------------------------------------------------------
!
!-------------------------------------------------------------------------------
! specifications for the KPP turbulence model
!
! Set "turb_method=99" in gotmturb.inp and check for the correct pre-processor
! macros in cppdefs.h.
! These are (see documentation at www.gotm.net):
!
! NONLOCAL for inclusion of non-local fluxes
! KPP_SHEAR for shear instability interior mixing
! KPP_INTERNAL_WAVE for internal waves interior mixing
! KPP_CONVEC for convective interior mixing
! KPP_DDMIX for double-diffusion interior mixing
! KPP_TWOPOINT_REF for two grid points to compute reference values
! KPP_IP_FC for scheme to interpolate MLD
! KPP_CLIP_GS for clipping of shape function G(sigma)
! KPP_SALINITY for computation of salinity diffusivity
!
! These pre-processor macros have been introduced for higher efficiency
! of the code.
!
! The main flags for the KPP algorithm can be set in this file.
! They are:
!
! kpp_sbl -> .true. for active surface boundary layer module
! kpp_bbl -> .true. for active bottom boundary layer module
! kpp_internal -> .true. for active interior mixing
! clip_mld -> .true. for clipping of MLD at MO or Ekman scale
! Ric -> critical value of bulk Richardson number
!
!-------------------------------------------------------------------------------
&kpp
kpp_sbl= .true.
kpp_bbl= .true.
kpp_interior= .true.
clip_mld= .false.
Ric= 0.3
/
This diff is collapsed.