Commit 69af1434 authored by ymeur's avatar ymeur
Browse files

Can now start the model from ERA5 forcing when using etat0=database.

The switch between the legacy version (LMDZ start) and ERA5 is done by using a new run.def parameter :
etat0_database_type = legacy (default) / ERA5_forcing

YM
parent 8ed7a945
Pipeline #183570 passed with stages
in 7 minutes and 49 seconds
......@@ -6,11 +6,39 @@ CONTAINS
SUBROUTINE init_etat0
USE xios_mod
USE omp_para
USE getin_mod, ONLY : getin
IMPLICIT NONE
CHARACTER(LEN=256) :: etat0_database_type
etat0_database_type="legacy"
CALL getin("etat0_database_type",etat0_database_type)
IF (is_omp_master) THEN
CALL xios_set_fieldgroup_attr("read_fields",enabled=.TRUE.)
CALL xios_set_filegroup_attr("read_files",enabled=.TRUE.)
IF (TRIM(etat0_database_type)=="legacy") THEN
CALL xios_set_filegroup_attr("read_files_legacy",enabled=.TRUE.)
CALL xios_set_field_attr("relief_db",field_ref="relief_db_legacy")
CALL xios_set_field_attr("ps_db",field_ref="ps_db_legacy")
CALL xios_set_field_attr("z_db",field_ref="z_db_legacy")
CALL xios_set_field_attr("ts_db",field_ref="ts_db_legacy")
CALL xios_set_field_attr("u_db",field_ref="u_db_legacy")
CALL xios_set_field_attr("v_db",field_ref="v_db_legacy")
CALL xios_set_field_attr("temp_db",field_ref="temp_db_legacy")
CALL xios_set_field_attr("q_db",field_ref="q_db_legacy")
ELSE IF (TRIM(etat0_database_type)=="ERA5_forcing") THEN
CALL xios_set_filegroup_attr("read_files_ERA5_forcing",enabled=.TRUE.)
CALL xios_set_field_attr("relief_db",field_ref="relief_db_forcing")
CALL xios_set_field_attr("ps_db",field_ref="ps_db_forcing")
CALL xios_set_field_attr("z_db",field_ref="z_db_forcing")
CALL xios_set_field_attr("ts_db",field_ref="ts_db_forcing")
CALL xios_set_field_attr("u_db",field_ref="u_db_forcing")
CALL xios_set_field_attr("v_db",field_ref="v_db_forcing")
CALL xios_set_field_attr("temp_db",field_ref="temp_db_forcing")
CALL xios_set_field_attr("q_db",field_ref="q_db_forcing")
ELSE
PRINT*,"Bad selector for variable <etat0_database_type> ",TRIM(etat0_database_type), " option are <legacy> (default), <ERA5_forcing>"
STOP
ENDIF
ENDIF
END SUBROUTINE init_etat0
......
......@@ -218,17 +218,21 @@
<field_definition>
<field_group id="read_fields" enabled="false" operation="instant">
<field id="relief_db" field_ref="relief_reg" domain_ref="from_relief" read_access="true" />
<!-- field_ref attribute will be added automatically from model -->
<!-- folowing etat0_database_type option "legacy" or "ERA5_forcing "-->
<!-- ex : <field id="ps_db" field_ref="ps_db_legacy"> -->
<field id="relief_db" domain_ref="from_relief" read_access="true" />
<field_group domain_ref="from_ecdyn" read_access="true" >
<field id="ps_db" field_ref="ps_reg" />
<field id="z_db" field_ref="z_reg" />
<field id="ts_db" field_ref="ts_reg" />
<field id="ps_db" />
<field id="z_db" />
<field id="ts_db" />
<field_group axis_ref="lev_ecdyn" >
<field id="u_db" field_ref="u_reg" />
<field id="v_db" field_ref="v_reg" />
<field id="temp_db" field_ref="temp_reg" />
<field id="q_db" field_ref="q_reg" />
<field id="u_db" />
<field id="v_db" />
<field id="temp_db" />
<field id="q_db" />
</field_group>
</field_group>
......@@ -237,24 +241,45 @@
</field_definition>
<file_definition>
<file_group id="read_files" enabled="false" >
<file_group id="read_files_legacy" enabled="false" >
<file id="relief" name="Relief" type="one_file" mode="read" output_freq="10ts">
<field id="relief_reg" name="RELIEF" domain_ref="domain_relief" operation="instant" />
<field id="relief_db_legacy" name="RELIEF" domain_ref="domain_relief" operation="instant" />
</file>
<file id="ECDYN" name="ECDYN" type="one_file" mode="read" output_freq="10ts">
<field_group domain_ref="domain_ecdyn" operation="instant">
<field id="ps_reg" name="SP" />
<field id="z_reg" name="Z" />
<field id="ts_reg" name="ST" />
<field id="ps_db_legacy" name="SP" />
<field id="z_db_legacy" name="Z" />
<field id="ts_db_legacy" name="ST" />
<field_group axis_ref="lev_ecdyn" >
<field id="u_reg" name="U" />
<field id="v_reg" name="V" />
<field id="temp_reg" name="TEMP" />
<field id="q_reg" name="R" />
<field id="u_db_legacy" name="U" />
<field id="v_db_legacy" name="V" />
<field id="temp_db_legacy" name="TEMP" />
<field id="q_db_legacy" name="R" />
</field_group>
</field_group>
</file>
</file_group>
<file_group id="read_files_ERA5_forcing" enabled="false" >
<file name="nudging_forcing" type="one_file" mode="read" output_freq="1000y" time_counter_name="time">
<field id="relief_db_forcing" name="z" domain_ref="domain_relief" operation="once"> this/9.81 </field>
<field_group domain_ref="domain_ecdyn" operation="once">
<field id="ps_db_forcing" name="sp" />
<field id="z_db_forcing" name="z" />
<field id="ts_db_forcing" name="t2m" />
<field_group axis_ref="lev_ecdyn" >
<field id="u_db_forcing" name="u" />
<field id="v_db_forcing" name="v" />
<field id="temp_db_forcing" name="t" />
<field id="q_db_forcing" name="r" />
</field_group>
</field_group>
</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment