Skip to content

Commit

Permalink
cmems/manual
Browse files Browse the repository at this point in the history
  • Loading branch information
cfontana00 committed Jun 7, 2024
1 parent e50dbba commit 608cafd
Show file tree
Hide file tree
Showing 30 changed files with 1,901 additions and 77 deletions.
3 changes: 3 additions & 0 deletions config/cmems_TEMPLATE.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Model_variable CMEMS_products CMEMS_variable
chl cmems_obs-oc_med_bgc-plankton_my_l3-multi-1km_P1D CHL
thetao SST_MED_SST_L3S_NRT_OBSERVATIONS_010_012_a sea_surface_temperature
45 changes: 33 additions & 12 deletions config/config_FUMSECK.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"_____":"GENERAL PARAMETERS",

"date_ini":"2019-05-01",
"date_ini":"2019-05-06",
"date_end":"2019-05-15",
"outdir":"/DISK2TB/MODEL/FUMSECK",
"diagdir":"/DISK2TB/MODEL/DIAGS",


"_____":"RIVER PARAMETERS",

"french_list":["Argens","Var"],
"italian_list":["Arno","Magra","Magra","Serchio","Ombrone"],
"river_ini":"2019-01-01",
"river_end":"2019-12-31",
"italian_list":["Arno","Magra","Ombrone","Serchio"],
"river_ini":"2015-03-01",
"river_end":"2019-04-30",


"_____":"METEO PARAMETERS",
Expand Down Expand Up @@ -40,6 +39,7 @@
"_____":"CMEMS",



"_____":"ARGO",

"argo_ds":"phy",
Expand All @@ -49,22 +49,33 @@

"resol":"10m",
"fig_proj":"ccrs.PlateCarree()",

"fig_sx":"8",
"fig_sy":"8",
"fig_fmt":"jpg",
"fig_res":"300",
"tight":"True",
"fig_tck_size":"10",
"fig_tcklbl_size":"10",
"fig_lbl_size":"10",
"cb_fraction_2D":"0.02",

"fig_tck_size":"6",
"fig_tcklbl_size":"6",
"fig_lbl_size":"6",
"cb_pad_2D":"0.12",
"cb_fraction_2D":"0.02",

"fig_sx_sat":"7",
"fig_sy_sat":"4",
"fig_tck_size_sat":"4",
"fig_tcklbl_size_sat":"4",
"cb_pad_sat":"0.12",
"cb_fraction_sat":"0.02",
"cb_pad_sat":"0.04",
"cb_lbl_size_sat":"6",

"with_currents":"False",
"with_whales":"False",
"with_whales":"True",

"_____":"SECTION PLOT PARAMETERS",


"fig_secx":"8",
"fig_secy":"4",
"sec_lon1":"9",
Expand All @@ -77,6 +88,16 @@
"cb_fraction_sec":"0.025",
"cb_pad_sec":"0.06",

"_____":"TRANSECT PLOT PARAMETERS",

"trans_ini":"2015-04-01",
"trans_end":"2015-04-19",
"trans_depth":200,
"trans_resV":1,
"trans_name":"eddy",
"trans_file":"/DISK2TB/DATA/eddy.dat",


"_____":"PROFILE PLOT PARAMETERS",

"fig_prox":"6",
Expand All @@ -87,7 +108,7 @@

"_____":"INTERPOLATION PARAMETERS",

"dump":"0.01",
"dump":"0.02",
"itp_meth":"linear",
"cmap":"viridis"

Expand Down
98 changes: 67 additions & 31 deletions config/config_TEMPLATE.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
{
"_____":"GENERAL PARAMETERS",

"date_ini":"2021-12-11",
"date_end":"2021-12-12",
"outdir":"/path/to/OUTPUT_SMP",
"diagdir":"/path/to/diags/dir",
"river_ini":"2015-01-03",
"river_end":"2015-05-01",

"date_ini":"2015-04-01",
"date_end":"2015-04-21",
"outdir":"/DISK2TB/MODEL/OUTPUTS3",
"diagdir":"/DISK2TB/MODEL/DIAGS",
"rm_boundary":"no",
"damping":20,

"_____":"RIVER PARAMETERS",

"french_list":["Argens","Var"],
"italian_list":["Arno","Magra","Ombrone","Serchio"],
"river_ini":"2015-03-01",
"river_end":"2019-04-30",


"_____":"METEO PARAMETERS",
"meteo_ini":"2015-03-10",
"meteo_end":"2015-03-11",
"day_cycle":10,
"n_cycle":6,

"meteo_ini":"2015-03-01",
"meteo_end":"2015-04-30",
"day_cycle":2,
"n_cycle":30,
"imin":"500",
"imax":"600",
"jmin":"350",
"jmax":"450",

"_____":"ARGO",

"argo_ds":"phy",


"_____":"MODIS PARAMETERS",
"modis_dir":"/DISK2TB/DATA/NWMED/MODIS",

"_____":"DYFAMED PARAMETERS",

Expand All @@ -39,48 +38,85 @@

"some_par":"some_par",

"_____":"SATELLITE",



"_____":"ARGO",

"argo_ds":"phy",


"_____":"2D PLOT PARAMETERS",
"_____":"PLOT PARAMETERS",

"resol":"10m",
"fig_proj":"ccrs.PlateCarree()",

"fig_sx":"8",
"fig_sy":"8",
"fig_fmt":"jpg",
"fig_res":"300",
"tight":"False",
"fig_tck_size":"10",
"fig_tcklbl_size":"10",
"fig_lbl_size":"10",
"cb_fraction_2D":"0.02",
"tight":"True",

"fig_tck_size":"6",
"fig_tcklbl_size":"4",
"fig_lbl_size":"4",
"fig_title_size":"6",
"cb_pad_2D":"0.12",
"cb_fraction_2D":"0.02",

"fig_sx_sat":"7",
"fig_sy_sat":"4",
"fig_tck_size_sat":"4",
"fig_tcklbl_size_sat":"4",
"cb_pad_sat":"0.12",
"cb_fraction_sat":"0.02",
"cb_pad_sat":"0.04",
"cb_tck_size_sat":"4",
"cb_lbl_size_sat":"6",

"with_currents":"False",
"with_whales":"True",

"_____":"SECTION PLOT PARAMETERS",

"fig_secx":"8",
"fig_secy":"4",
"sec_lon1":"8.5",
"sec_lon1":"9",
"sec_lat1":"43.",
"sec_lon2":"10.",
"sec_lat2":"43.5",
"sec_dep":"600",
"sec_lon2":"9.7",
"sec_lat2":"44",
"sec_dep":"300",
"sec_resH":"0.05",
"sec_resV":"1",
"cb_fraction_sec":"0.025",
"cb_pad_sec":"0.06",

"_____":"TRANSECT PLOT PARAMETERS",

"trans_ini":"2015-04-01",
"trans_end":"2015-04-19",
"trans_depth":200,
"trans_resV":1,
"trans_name":"eddy",
"trans_file":"/DISK2TB/DATA/eddy.dat",


"_____":"PROFILE PLOT PARAMETERS",

"fig_prox":"8",
"fig_proy":"4",
"fig_prox":"6",
"fig_proy":"11",
"col_bcg":["g","b","r"],
"col_phy":["b","r"],


"_____":"TIME SERIES PLOT PARAMETERS",
"fig_tsx":8,
"fig_tsy":5,

"_____":"INTERPOLATION PARAMETERS",

"dump":"0.01",
"itp_meth":"nearest"
"dump":"0.02",
"itp_meth":"linear",
"cmap":"viridis"

}
2 changes: 1 addition & 1 deletion config/variables_mit_FUMSECK.dat
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ po4 NUTR cmc.batlow False set 0. 0.3 PO4 $mmol.m^{-3}$
si NUTR jet False set 0. 1. SI $mmol.m^{-3}$
chl PFTC cmc.imola True set 0.05 0.3 Chlorophyll $mg.m^{-3}$
phyc PFTC jet False set 0. 1. Phytoplankton $mmol.m^{-3}$
zooc PFTC cmc.hawaii_r False set 1. 3. Zooplankton $mg.m^{-3}$
zooc PFTC cmc.davos False set 1. 3. Zooplankton $mg.m^{-3}$
so PSAL jet False set 0. 1. Salinity none
uo RFVL cmc.vik False set -.3 .3 Eastward_current $m.s^{-1}$
vo RFVL jet False set 0. 1. Northward_current $m.s^{-1}$
Expand Down
15 changes: 10 additions & 5 deletions config/variables_mit_TEMPLATE.dat
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ ph CARB jet False set 0. 1. lab un
talk CARB jet False set 0. 1. lab un
spco2 CO2F jet False set 0. 1. lab un
nh4 NUTR jet False set 0. 1. NH4 $mmol.m^{-3}$
no3 NUTR cmc.hawaii_r False set 0.5 4. NO3 $mmol.m^{-3}$
no3 NUTR cmc.hawaii_r False set 0.5 4. NO3 mmol.m$^{-3}$
po4 NUTR cmc.batlow False set 0. 0.3 PO4 $mmol.m^{-3}$
si NUTR jet False set 0. 1. SI $mmol.m^{-3}$
chl PFTC cmc.imola True set 0.05 0.5 Chlorophyll $mg.m^{-3}$
chl PFTC cmo.algae True set 0.05 0.8 Chlorophyll mg.m$^{-3}$
phyc PFTC jet False set 0. 1. Phytoplankton $mmol.m^{-3}$
zooc PFTC cmc.broc False set 0. 3. Zooplankton $mg.m^{-3}$
zooc PFTC cmc.broc False set 0. 3. Zooplankton mg.m$^{-3}$
so PSAL jet False set 0. 1. Salinity none
uo RFVL cmc.vik False set -.3 .3 Eastward_current $m.s^{-1}$
uo RFVL cmc.vik False set -.3 .3 Eastward_current m.s$^{-1}$
vo RFVL jet False set 0. 1. Northward_current $m.s^{-1}$
thetao TEMP cmo.thermal False set 13.5 14.8 Temperature °C
thetao TEMP cmo.thermal False set 14.5 17 Temperature °C
so PSAL cmo.magma False set 37 38.5 Salinity -

# Meteo
u10 uwind cmc.vik False set -10 10 Westward_wind m.s$^{-1}$

6 changes: 0 additions & 6 deletions datasets/CMEMS/get_data.py

This file was deleted.

81 changes: 81 additions & 0 deletions datasets/CMEMS/get_data_sat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#############################
# Routine to get CMEMS data #
#############################
import warnings
warnings.simplefilter("ignore")
from fun_gen import *
from fun_io import *
import os
import sys
import copernicusmarine
import datetime as dt


# Get args
# --------
config = sys.argv[1] # Configuration name
var = sys.argv[2] # Configuration name



# Load parameters
# ---------------
load_config(config)
from fun_gen import *

# Create arborescence
# -------------------
vdir = create_arbo(config,var,'CMEMS')
datadir = diagdir+'/'+config+'/CMEMS/data'
os.system('mkdir -p '+datadir)

usr = os.getenv('COPERNICUSMARINE_SERVICE_USERNAM')
pswd = os.getenv('COPERNICUSMARINE_SERVICE_PASSWORD')

# Load coordinates
# ----------------
lon,lat,lev = load_coords()

# Load CMEMS parameters
# ---------------------
pars = np.loadtxt('../../config/cmems_'+config+'.dat',dtype=str)

# Loop on variables
for par in pars:
if par[0] == var:
break

ds_id = par[1]
cvar = par[2]

if var == 'chl':
cvar = ['CHL','KD490']
else :
cvar = [cvar]


print('Downloading CMEMS products :',ds_id)
print('=> Variable',cvar,'\n')

copernicusmarine.subset(
dataset_id = ds_id,
minimum_longitude = lon.min()-1,
maximum_longitude = lon.max()+1,
minimum_latitude = lat.min()-1,
maximum_latitude = lat.max()+1,
start_datetime = date_ini,
end_datetime = date_end,
#variables = cvar,
output_directory = datadir,
output_filename = ds_id+'.nc',
username = usr,
password = pswd,
force_download = 'true'
)

print('')
print('[FILE SAVED ]',datadir+'/'+ds_id+'.nc')




Loading

0 comments on commit 608cafd

Please sign in to comment.