Changeset 408 for branches


Ignore:
Timestamp:
2011-08-29T10:08:49+02:00 (13 years ago)
Author:
didier.solyga
Message:

Merge the revisions 388 to 396 from the trunk. Now the externalized version is based on ORCHIDEE_1_9_5_2

Location:
branches/ORCHIDEE_EXT/ORCHIDEE_OL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_EXT/ORCHIDEE_OL/SPINUP/COMP/spinup.driver

    r382 r408  
    299299 
    300300    IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card UserChoices sechiba_LEVEL ${spinup_UserChoices_sechiba_LEVEL} 
    301     spinup_SubJobPost_sechiba_TimeSeriesVars0=${spinup_SubJobPost_sechiba_TimeSeriesVars2D[0]} > /dev/null 2>&1 
     301    spinup_SubJobPost_sechiba_TimeSeriesVars0=${spinup_SubJobPost_sechiba_TimeSeriesVars2D[0]} 
    302302    if [ X${spinup_SubJobPost_sechiba_TimeSeriesVars0} != X${NULL_STR} ] ; then 
    303         IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars2D "("$( echo ${spinup_SubJobPost_sechiba_TimeSeriesVars[@]} | sed -e "s/ /,/g" )")" 
     303        IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars2D "("$( echo ${spinup_SubJobPost_sechiba_TimeSeriesVars2D[@]} | sed -e "s/ /,/g" )")" 
    304304    else 
    305305        IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars2D "()" 
    306306    fi 
    307     spinup_SubJobPost_sechiba_TimeSeriesVars0=${spinup_SubJobPost_sechiba_TimeSeriesVars3D[0]} > /dev/null 2>&1 
     307    spinup_SubJobPost_sechiba_TimeSeriesVars0=${spinup_SubJobPost_sechiba_TimeSeriesVars3D[0]} 
    308308    if [ X${spinup_SubJobPost_sechiba_TimeSeriesVars0} != X${NULL_STR} ] ; then 
    309         IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars3D "("$( echo ${spinup_SubJobPost_sechiba_TimeSeriesVars[@]} | sed -e "s/ /,/g" )")" 
     309        IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars3D "("$( echo ${spinup_SubJobPost_sechiba_TimeSeriesVars3D[@]} | sed -e "s/ /,/g" )")" 
    310310    else 
    311311        IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/sechiba.card Post_1M_sechiba_history TimeSeriesVars3D "()" 
     
    646646 
    647647            # We Get the forcing file from the previous run of ORCHIDEE 
    648             ORCHIDEE_JobName=${LastJobName} 
    649             sed -e "s&(\${config_SBG_RestartPath}/\${config_SBG_RestartJobName}/SBG/Restart/\${config_SBG_RestartJobName}_\${Date_Restarts}_stomate_forcing.nc, stomate_forcing.nc)&(${config_SBG_RestartPath}/${ORCHIDEE_JobName}/SBG/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_stomate_forcing.nc, stomate_forcing.nc)&" ${New_SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp 
     648            sed -e "s&(\${config_SBG_RestartPath}/\${config_SBG_RestartJobName}/SBG/Restart/\${config_SBG_RestartJobName}_\${Date_Restarts}_stomate_forcing.nc, stomate_forcing.nc)&(${config_SBG_RestartPath}/${LastJobName}/SBG/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_stomate_forcing.nc, stomate_forcing.nc)&" ${New_SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp 
    650649            IGCM_sys_Mv sechiba.card.tmp ${New_SUBMIT_DIR}/COMP/sechiba.card 
    651650 
     
    661660                fi 
    662661            done 
     662            eval IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card Post RebuildFrequency ${config_SubJob_PeriodLength} 
    663663            eval IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card Post TimeSeriesFrequency ${config_SubJob_PeriodLength} 
    664664 
     
    769769 
    770770            # We Get the forcing file from the previous run of ORCHIDEE 
    771             ORCHIDEE_JobName=${config_UserChoices_JobName}ORC_${iter} 
    772             sed -e "s&(\${config_SBG_RestartPath}/\${config_SBG_RestartJobName}/SBG/Restart/\${config_SBG_RestartJobName}_\${Date_Restarts}_stomate_forcing.nc, stomate_forcing.nc)&(${config_SBG_RestartPath}/${ORCHIDEE_JobName}/SBG/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_stomate_forcing.nc, stomate_forcing.nc)&" ${New_SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp 
     771            sed -e "s&(\${config_SBG_RestartPath}/\${config_SBG_RestartJobName}/SBG/Restart/\${config_SBG_RestartJobName}_\${Date_Restarts}_stomate_forcing.nc, stomate_forcing.nc)&(${config_SBG_RestartPath}/${LastJobName}/SBG/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_stomate_forcing.nc, stomate_forcing.nc)&" ${New_SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp 
    773772            IGCM_sys_Mv sechiba.card.tmp ${New_SUBMIT_DIR}/COMP/sechiba.card 
    774773 
     
    784783                fi 
    785784            done 
     785            eval IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card Post RebuildFrequency ${config_SubJob_PeriodLength} 
    786786            eval IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card Post TimeSeriesFrequency ${config_SubJob_PeriodLength} 
    787787 
     
    812812 
    813813            # We Get the forcing file from the previous run of ORCHIDEE 
    814             ORCHIDEE_JobName=${config_UserChoices_JobName}${output_PreviousStage_LastExtName} 
    815814            IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/output.card PreviousStage LastRestartDate 
    816             if ( [ X${spinup_UserChoices_DEBUG_SPIN} = Xn ] ) ; then   
    817                 last_Cforcing=${config_SBG_RestartPath}/${config_UserChoices_JobName}/SPIN/Output/${ORCHIDEE_JobName}/SBG/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_stomate_Cforcing.nc 
    818             else 
    819                 last_Cforcing=${config_SBG_RestartPath}/${ORCHIDEE_JobName}/SBG/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_stomate_Cforcing.nc 
    820             fi 
    821             ls -lrt ${last_Cforcing} 
    822             IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/stomate.card BoundaryFiles ListNonDel "(${last_Cforcing}, stomate_Cforcing.nc), \\" 
     815 
     816            IGCM_card_WriteOption ${New_SUBMIT_DIR}/COMP/stomate.card BoundaryFiles ListNonDel \ 
     817                    "(${config_SBG_RestartPath}/${LastJobName}/SBG/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_stomate_Cforcing.nc, stomate_Cforcing.nc), \\" 
    823818 
    824819            # Nb years for forcing FORCESOIL 
     
    959954    echo "SECHIBA WriteFrequency : " ${config_SRF_WriteFrequency} 
    960955    if ( [ X${StageName} != X"TSTOINI" ] && [ X${StageName} != X"TSTO" ] && [ X${StageName} != X"FORC" ] ) ; then 
    961     IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card SRF WriteFrequency "${config_SRF_WriteFrequency}" 
     956        IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card SRF WriteFrequency "${config_SRF_WriteFrequency}" 
    962957    fi 
    963958    if [ X"${spinup_UserChoices_ok_stomate}" = "Xy" ] ; then 
    964959        echo "STOMATE WriteFrequency : " ${config_SBG_WriteFrequency} 
    965         IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card SBG WriteFrequency "${config_SBG_WriteFrequency}" 
     960        case $StageName in 
     961            "TSTOINI"|"TSTO") 
     962                IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card SBG WriteFrequency "1Y" 
     963                ;; 
     964            *) 
     965                IGCM_card_WriteOption ${New_SUBMIT_DIR}/config.card SBG WriteFrequency "${config_SBG_WriteFrequency}" 
     966        esac 
    966967    fi 
    967968 
     
    10051006    # Did it finish ? 
    10061007    if [ X${run_Configuration_PeriodState} != X"Completed" ] ; then 
    1007         IGCM_debug_Exit "SPIN_update Error Run SubJob : " ${SubJobName} 
     1008        IGCM_debug_Exit "SPIN_update Error Run SubJob : " ${SubJobName} ${run_Configuration_PeriodState} 
    10081009    fi 
    10091010    IGCM_debug_Verif_Exit 
     
    10231024    if [ X${StageName} = X"FORC" ] ; then 
    10241025        # This must be done on the ARCHIVE HOST. 
    1025         if ( [ X${spinup_UserChoices_DEBUG_SPIN} = Xn ] ) ; then   
    1026             last_restart=${config_SBG_RestartPath}/${config_UserChoices_JobName}/SPIN/Output/${ORCHIDEE_JobName}/SRF/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc 
    1027         else 
    1028             last_restart=${config_SBG_RestartPath}/${ORCHIDEE_JobName}/SRF/Restart/${ORCHIDEE_JobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc 
    1029         fi 
    10301026        IGCM_sys_MkdirArchive ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart 
    1031         IGCM_sys_RshArchive "cp -fp ${last_restart} ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart/${SubJobName}_${This_Job_DateEnd}_sechiba_rest.nc" 
     1027        IGCM_sys_RshArchive \ 
     1028            "cp -fp ${config_SBG_RestartPath}/${LastJobName}/SRF/Restart/${LastJobName}_${output_PreviousStage_LastRestartDate}_sechiba_rest.nc"\ 
     1029                  " ${config_SBG_RestartPath}/${SubJobName}/SRF/Restart/${SubJobName}_${This_Job_DateEnd}_sechiba_rest.nc" 
    10321030    fi 
    10331031 
     
    10471045        fi 
    10481046 
    1049         IGCM_sys_RshArchive "mv -f ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}${output_PreviousStage_LastExtName} ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/SPIN/Output/" 
     1047        IGCM_sys_RshArchive "mv -f ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}${output_PreviousStage_LastExtName}"\ 
     1048                                 " ${R_OUT}/${config_UserChoices_TagName}/${config_UserChoices_JobName}/SPIN/Output/" 
    10501049    fi 
    10511050 
  • branches/ORCHIDEE_EXT/ORCHIDEE_OL/forcesoil.f90

    r382 r408  
    187187  debug = .FALSE. 
    188188  CALL getin_p('DEBUG_INFO',debug) 
    189   ! 
    190   !Config Key  = LONGPRINT 
    191   !Config Desc = ORCHIDEE will print more messages 
    192   !Config Def  = n 
    193   !Config Help = This flag permits to print more debug messages in the run. 
    194   ! 
    195   long_print = .FALSE. 
    196   CALL getin_p('LONGPRINT',long_print) 
    197189  !- 
    198190  ! Stomate's restart files 
     
    312304                &      (rest_id_sto, varnames(iv), varnbdim_max, varnbdim, vardims) 
    313305           l1d = ALL(vardims(1:varnbdim) == 1) 
    314            !---- 
    315            ALLOCATE( var_3d(nbp_glo,vardims(3)), stat=ier) 
    316            IF (ier /= 0) STOP 'ALLOCATION PROBLEM' 
    317306           !---- read it 
    318307           IF (l1d) THEN 
     
    321310                   &         1, itau_dep, .TRUE., xtmp) 
    322311           ELSE 
     312              ALLOCATE( var_3d(nbp_glo,vardims(3)), stat=ier) 
     313              IF (ier /= 0) STOP 'ALLOCATION PROBLEM' 
     314              !---- 
    323315              CALL restget & 
    324316                   &        (rest_id_sto, TRIM(varnames(iv)), nbp_glo, vardims(3), & 
     
    334326                   &        (rest_id_sto, TRIM(varnames(iv)), nbp_glo, vardims(3), & 
    335327                   &         1, itau_dep, var_3d, 'scatter',  nbp_glo, indices_g) 
     328              !---- 
     329              DEALLOCATE(var_3d) 
    336330           ENDIF 
    337            !---- 
    338            DEALLOCATE(var_3d) 
    339331        ENDIF 
    340332     ENDDO 
  • branches/ORCHIDEE_EXT/ORCHIDEE_OL/teststomate.f90

    r382 r408  
    7474  REAL, ALLOCATABLE, DIMENSION(:)    :: lon_rect, lat_rect 
    7575  REAL(r_std)                       :: dt 
    76   INTEGER(i_std)                    :: itau_dep,itau,itau_len,itau_step 
     76  INTEGER(i_std)                    :: itau_dep,itau_fin,itau,itau_len,itau_step 
    7777  REAL(r_std)                       :: date0 
    7878  INTEGER(i_std)                    :: rest_id_sec,rest_id_sto 
     
    113113 
    114114  REAL(r_std),DIMENSION(:,:),ALLOCATABLE :: var_3d 
     115  REAL(r_std) :: var_1d(1) 
    115116 
    116117!- 
     
    375376  CALL bcast(rest_id_sec) 
    376377  CALL bcast(rest_id_sto) 
     378  CALL bcast(itau_dep) 
    377379  CALL bcast(date0) 
    378380  CALL bcast(dt) 
     
    404406  ALLOCATE(lon(iim,jjm)) 
    405407  ALLOCATE(lat(iim,jjm)) 
     408  lon=zero 
     409  lat=zero 
    406410  CALL scatter2D(lon_g,lon) 
    407411  CALL scatter2D(lat_g,lat) 
    408   IF (debug) THEN 
    409      IF (is_root_prc) THEN 
    410         WRITE(numout,*) mpi_rank, lat_g 
    411         WRITE(numout,*) mpi_rank, lon_g 
    412      ENDIF 
    413      WRITE(numout,*) mpi_rank, lat 
    414      WRITE(numout,*) mpi_rank, lon 
    415   ENDIF 
    416412 
    417413  DO ji=1,kjpindex 
     
    587583!- 
    588584  WRITE(time_str,'(a)') '1Y' 
    589   CALL getin ('TIME_LENGTH', time_str) 
     585  CALL getin_p ('TIME_LENGTH', time_str) 
    590586! transform into itau 
    591587  CALL tlen2itau(time_str, dt, date0, itau_len) 
     
    593589  itau_len = NINT( MAX(1.,FLOAT(NINT(itau_len*dtradia/dt_force))) & 
    594590       &                *dt_force/dtradia) 
     591  !- 
     592  itau_fin = itau_dep+itau_len 
    595593  !- 
    596594  ! set up STOMATE history file 
     
    851849  l_first_intersurf=.FALSE. 
    852850  ! 
    853   DO itau = itau_dep+itau_step,itau_dep+itau_len,itau_step 
     851  DO itau = itau_dep+itau_step,itau_fin,itau_step 
     852    ! 
     853    CALL intsurf_time( itau, date0, dtradia ) 
    854854     ! 
    855855!-- next forcing state 
    856856    iisf = iisf+1 
     857    IF (debug) WRITE(numout,*) "itau,iisf : ",itau,iisf 
    857858!--- 
    858859    IF (iisf .GT. nsfm) THEN 
     
    927928 &     rest_id_sec, hist_id_sec, hist_id_sec2, rest_id_sto, hist_id_stom, hist_id_stom_IPCC, co2_flux, fco2_lu) 
    928929     day_counter = one_day - dt_force 
    929      ! 
    930      CALL intsurf_time( itau+itau_step, date0, dtradia ) 
    931930  ENDDO ! end of the time loop 
    932 !- 
    933   itau = itau -itau_step 
    934931!- 
    935932! write restart files 
     
    948945!-- check if the variable is to be written here 
    949946        IF (INDEX( taboo_vars,'$'//TRIM(varnames(iv))//'$') .EQ. 0 ) THEN 
     947           IF (debug) WRITE(numout,*) "restart var : ",TRIM(varnames(iv)),itau_dep,itau_fin 
     948 
    950949!---- get variable dimensions, especially 3rd dimension 
    951950           CALL ioget_vdim & 
    952951                &      (rest_id_sec, varnames(iv), varnbdim_max, varnbdim, vardims) 
    953952           l1d = ALL(vardims(1:varnbdim) .EQ. 1) 
    954            ALLOCATE(var_3d(nbp_glo,vardims(3)),stat=ier) 
    955            IF (ier .NE. 0) STOP 'ALLOCATION PROBLEM' 
    956953!---- read it 
    957954           IF (l1d) THEN 
    958955              CALL restget (rest_id_sec,TRIM(varnames(iv)), & 
    959              1,vardims(3),1,itau_dep,.TRUE.,var_3d) 
     956                   1,1,1,itau_dep,.TRUE.,var_1d) 
    960957           ELSE 
     958              ALLOCATE(var_3d(nbp_glo,vardims(3)),stat=ier) 
     959              IF (ier .NE. 0) STOP 'ALLOCATION PROBLEM' 
    961960              CALL restget (rest_id_sec,TRIM(varnames(iv)), & 
    962961                   nbp_glo,vardims(3),1,itau_dep,.TRUE.,var_3d, & 
     
    966965           IF (l1d) THEN 
    967966              CALL restput (rest_id_sec,TRIM(varnames(iv)), & 
    968                    1,vardims(3),1,itau,var_3d) 
     967                   1,1,1,itau_fin,var_1d) 
    969968           ELSE 
    970969              CALL restput (rest_id_sec,TRIM(varnames(iv)), & 
    971                    nbp_glo,vardims(3),1,itau,var_3d, & 
     970                   nbp_glo,vardims(3),1,itau_fin,var_3d, & 
    972971                   'scatter',nbp_glo,indices_g) 
     972              DEALLOCATE (var_3d) 
    973973           ENDIF 
    974            DEALLOCATE (var_3d) 
    975974        ENDIF 
    976975     ENDDO 
     
    982981  ldrestart_write = .TRUE. 
    983982!- 
     983  IF (debug) WRITE(numout,*) "Call slowproc for restart." 
    984984  CALL slowproc_main & 
    985  &  (itau, kjpij, kjpindex, dt_force, date0, & 
     985 &  (itau_fin, kjpij, kjpindex, dt_force, date0, & 
    986986 &   ldrestart_read, ldrestart_write, .FALSE., .TRUE., & 
    987987 &   indices, indexveg, lalo, neighbours, resolution, contfrac, soiltype, & 
     
    994994! close files 
    995995!- 
    996   IF (is_root_prc) & 
    997        CALL restclo 
     996  IF (is_root_prc) THEN 
     997     CALL restclo 
     998     IF ( debug )  WRITE(numout,*) 'REST CLOSED' 
     999  ENDIF 
    9981000  CALL histclo 
    9991001 
     
    10031005  IF (is_root_prc) THEN 
    10041006     CALL getin_dump() 
    1005      IF ( debug )  WRITE(numout,*) 'REST CLOSED' 
    10061007  ENDIF 
    10071008#ifdef CPP_PARA 
Note: See TracChangeset for help on using the changeset viewer.