Changeset 269 for trunk


Ignore:
Timestamp:
05/06/10 16:28:09 (14 years ago)
Author:
mmaipsl
Message:

BIG IMPROVMENT :
Add new function IGCM_comp_PeriodStart to the main loop.
This function is called after IGCM_config_PeriodStart, then all Period and date
variables will be set correctly. And it is used before libIGCM read INIT and BC component's lists.
It will read new (and optionnal) component function ${compname}_PeriodStart function
in each ${compname}.driver files. Those new functions will give you the possibility
to set some variables used inside BC or INIT list.
For example :
in my orchidee.card, I want to change a file in BC list during the run and that depends on the year
[BoundaryFiles?]
List= (${BC_SRF_PFTmap} PFTmap.nc)
ListNonDel?= ()
(! remark that I must have suppressed the comma in the List !)

I set this variable in my orchidee.driver like that :
function SRF_PeriodStart
{

IGCM_debug_PushStack "SRF_PeriodStart"
if [ ${year} -gt 1994 ] ; then

PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/ORCHIDEE_PFTmap_2006to2100_AR5_RCP8.5_MESSAGE.nc"
if [ ${year} -eq 1995 ] ; then

IGCM_sys_Rm -f PFTmap.nc
BC_SRF_PFTmap=${PFTmap}

fi

else

PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/ORCHIDEE_PFTmap_1850to2005_AR5_LUHa.rc2.nc"

fi
IGCM_debug_PopStack "SRF_PeriodStart"

}

Then I can change the LAND USE file without stopping my job.

Location:
trunk/libIGCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_job

    r265 r269  
    292292    #D- 
    293293    # ------------------------------------------------------------------ 
     294    #D- Optionnal function in driver  
     295    #D- to set special variables used in forward lists (Param, Init or Bc). 
     296    # ------------------------------------------------------------------ 
     297    IGCM_comp_PeriodStart 
     298     
     299    #D- 
     300    # ------------------------------------------------------------------ 
    294301    #D- Get parameters text files updated by job (.def, namelist ...) 
    295302    #D- READ AND USE BY GCM AT EACH EXECUTION. 
  • trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh

    r260 r269  
    709709 
    710710#======================================================================= 
     711function IGCM_comp_PeriodStart 
     712{ 
     713    IGCM_debug_PushStack "IGCM_comp_PeriodStart" 
     714 
     715    # Debug Print : 
     716    echo 
     717    IGCM_debug_Print 1 "IGCM_comp_PeriodStart :" 
     718    echo 
     719 
     720    typeset ExeNameIn ExeNameOut  
     721    typeset comp compname comptagname 
     722    for comp in ${config_ListOfComponents[*]} ; do 
     723        # Define component  
     724        eval compname=\${config_ListOfComponents_${comp}[0]} > /dev/null 2>&1 
     725        eval comptagname=\${config_ListOfComponents_${comp}[1]} > /dev/null 2>&1 
     726 
     727        # Copy executable for this component 
     728        eval ExeNameIn=\${config_Executable_${comp}[0]} 
     729        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     730 
     731        # Debug Print 
     732        IGCM_debug_Print 3 "PeriodStart ${compname} Driver Function (if any)." 
     733        # UPDATE component 
     734        ${comp}_PeriodStart 2> /dev/null 
     735 
     736    done 
     737 
     738    IGCM_debug_PopStack "IGCM_comp_PeriodStart" 
     739} 
     740 
     741#======================================================================= 
    711742function IGCM_comp_Update 
    712743{ 
Note: See TracChangeset for help on using the changeset viewer.