#!/bin/ksh
#-----------------------------------
function IOS_Initialize
{ 
    IGCM_debug_PushStack "IOS_Initialize"

    echo INITIALIZE IOS !!!

    IGCM_debug_PopStack "IOS_Initialize"
}

#-----------------------------------
function IOS_Update
{
    IGCM_debug_PushStack "IOS_Update"

    echo UPDATE IOS !!!
# Activate server mode
    IGCM_comp_modifyXmlFile force iodef.xml using_server NONE true

# Activate 2nd server level for CMIP6 type experiments (CMIP6 workflow)

    if ( [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] || [ X"$( echo ${config_UserChoices_ExpType} | grep MR025 )" != "X" ] || [ X${config_Post_dr2xmlIPSL} = XTRUE ] ) ; then
       IGCM_comp_modifyXmlFile force iodef.xml using_server2 NONE true
    fi

    if [ -f namcouple ] ; then
	sed -e "s/2  LMDZ oceanx/3 LMDZ oceanx ${config_Executable_IOS[1]}/" namcouple > namcouple.tmp 
	IGCM_sys_Mv namcouple.tmp namcouple
    fi

    IGCM_debug_PopStack "IOS_Update"
}

#-----------------------------------
function IOS_Finalize
{
    IGCM_debug_PushStack "IOS_Finalize"

    echo FINALIZE IOS !!!

    IGCM_debug_PopStack "IOS_Finalize"
}
