Ignore:
Timestamp:
Jan 24, 2011, 1:57:13 PM (14 years ago)
Author:
aslmd
Message:

spiga@svn-planeto:les copains j ai fait ce changement

Location:
trunk/mesoscale/LMD_MM_MARS/SRC/WPS/metgrid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/metgrid/METGRID.TBL.ARW

    r11 r12  
    5454        fill_lev = 4 : SOILM040(200100)     
    5555        fill_lev = 5 : SOILM160(200100)     
    56         fill_lev = 6 : SOILM300(200100)     
     56        fill_lev = 6 : SOILM300(200100)     
    5757========================================
    5858name=SOILT
     
    9797========================================
    9898name=SKINTEMP
    99         interp_option=sixteen_pt+four_pt+wt_average_4pt+wt_average_16pt+search
     99#        interp_option=sixteen_pt+four_pt+wt_average_4pt+wt_average_16pt+search
     100#        interp_option=four_pt
     101#        mandatory=yes    # MUST HAVE THIS FIELD
     102## commenter les trois prochaines lignes ?
     103#        masked=both
     104#        interp_land_mask  = LANDSEA(1)
     105#        interp_water_mask = LANDSEA(0)
     106#        fill_missing=0.
    100107        mandatory=yes    # MUST HAVE THIS FIELD
    101         masked=both
    102         interp_land_mask  = LANDSEA(1)
    103         interp_water_mask = LANDSEA(0)
    104         fill_missing=0.
     108        interp_option=four_pt+average_4pt
     109        #careful: inputs from the GCMs are in a "polygonal" world !
     110        #        interp_option=sixteen_pt+four_pt+average_4pt
     111        interp_option=sixteen_pt+four_pt
     112        fill_missing=-1.0e+30
     113        missing_value=-9.99e+33
    105114========================================
    106115name=PSFC
    107         interp_option=four_pt+average_4pt
     116#        interp_option=four_pt+average_4pt
     117#        interp_option=sixteen_pt+average_16pt
     118#careful: inputs from the GCMs are in a "polygonal" world !
     119        interp_option=sixteen_pt+four_pt+average_4pt
    108120        fill_lev=200100:const(200100.)
    109121        flag_in_output=FLAG_PSFC
     
    122134========================================
    123135name=SW000010
    124         interp_option=sixteen_pt+four_pt+average_4pt+search
     136#        interp_option=sixteen_pt+four_pt+average_4pt+search
    125137        masked=water
    126138        interp_mask=LANDSEA(0)
     
    129141========================================
    130142name=SW010040
    131         interp_option=sixteen_pt+four_pt+average_4pt+search
     143#        interp_option=sixteen_pt+four_pt+average_4pt+search
    132144        masked=water
    133145        interp_mask=LANDSEA(0)
     
    136148========================================
    137149name=SW040100
    138         interp_option=sixteen_pt+four_pt+average_4pt+search
     150#        interp_option=sixteen_pt+four_pt+average_4pt+search
    139151        masked=water
    140152        interp_mask=LANDSEA(0)
     
    143155========================================
    144156name=SW100200
    145         interp_option=sixteen_pt+four_pt+average_4pt+search
     157#        interp_option=sixteen_pt+four_pt+average_4pt+search
    146158        masked=water
    147159        interp_mask=LANDSEA(0)
     
    150162========================================
    151163name=SW010200
    152         interp_option=sixteen_pt+four_pt+average_4pt+search
     164#        interp_option=sixteen_pt+four_pt+average_4pt+search
    153165        masked=water
    154166        interp_mask=LANDSEA(0)
     
    157169========================================
    158170name=SM000010
    159         interp_option=sixteen_pt+four_pt+average_4pt+search
    160         masked=water
    161         interp_mask=LANDSEA(0)
     171#        interp_option=sixteen_pt+four_pt+average_4pt+search
     172        interp_option=four_pt
     173#        masked=water
     174#        interp_mask=LANDSEA(0)
    162175        fill_missing=1.
    163176        flag_in_output=FLAG_SM000010
    164177========================================
    165178name=SM010040
    166         interp_option=sixteen_pt+four_pt+average_4pt+search
    167         masked=water
    168         interp_mask=LANDSEA(0)
     179#        interp_option=sixteen_pt+four_pt+average_4pt+search
     180        interp_option=four_pt
     181#        masked=water
     182#        interp_mask=LANDSEA(0)
    169183        fill_missing=1.
    170184        flag_in_output=FLAG_SM010040
    171185========================================
    172186name=SM040100
    173         interp_option=sixteen_pt+four_pt+average_4pt+search
    174         masked=water
    175         interp_mask=LANDSEA(0)
     187#        interp_option=sixteen_pt+four_pt+average_4pt+search
     188        interp_option=four_pt
     189#        masked=water
     190#        interp_mask=LANDSEA(0)
    176191        fill_missing=1.
    177192        flag_in_output=FLAG_SM040100
    178193========================================
    179194name=SM100200
    180         interp_option=sixteen_pt+four_pt+average_4pt+search
    181         masked=water
    182         interp_mask=LANDSEA(0)
     195#        interp_option=sixteen_pt+four_pt+average_4pt+search
     196        interp_option=four_pt
     197#        masked=water
     198#        interp_mask=LANDSEA(0)
    183199        fill_missing=1.
    184200        flag_in_output=FLAG_SM100200
    185201========================================
    186202name=SM010200
    187         interp_option=sixteen_pt+four_pt+average_4pt+search
    188         masked=water
    189         interp_mask=LANDSEA(0)
     203#        interp_option=sixteen_pt+four_pt+average_4pt+search
     204        interp_option=four_pt
     205#        masked=water
     206#        interp_mask=LANDSEA(0)
    190207        fill_missing=1.
    191208        flag_in_output=FLAG_SM010200
    192209========================================
     210# EMISSIVITY
    193211name=ST000010
    194         interp_option=sixteen_pt+four_pt+average_4pt+search
    195         masked=water
    196         interp_mask=LANDSEA(0)
    197         fill_missing=285.
     212#        interp_option=sixteen_pt+four_pt+average_4pt+search
     213        interp_option=sixteen_pt+four_pt
     214#        masked=water
     215#        interp_mask=LANDSEA(0)
     216        fill_missing=0.
    198217        flag_in_output=FLAG_ST000010
    199218========================================
     219# CO2 ICE
    200220name=ST010040
    201         interp_option=sixteen_pt+four_pt+average_4pt+search
    202         masked=water
    203         interp_mask=LANDSEA(0)
    204         fill_missing=285.
     221#        interp_option=sixteen_pt+four_pt+average_4pt+search
     222#        interp_option=sixteen_pt+four_pt
     223        interp_option=four_pt
     224###ATTENTION sixteen_pt donne des valeurs negatives
     225#        masked=water
     226#        interp_mask=LANDSEA(0)
     227        fill_missing=0.
    205228        flag_in_output=FLAG_ST010040
    206229========================================
    207230name=ST040100
    208         interp_option=sixteen_pt+four_pt+average_4pt+search
    209         masked=water
    210         interp_mask=LANDSEA(0)
     231#        interp_option=sixteen_pt+four_pt+average_4pt+search
     232        interp_option=four_pt
     233#        masked=water
     234#        interp_mask=LANDSEA(0)
    211235        fill_missing=285.
    212236        flag_in_output=FLAG_ST040100
    213237========================================
    214238name=ST100200
    215         interp_option=sixteen_pt+four_pt+average_4pt+search
    216         masked=water
    217         interp_mask=LANDSEA(0)
     239#        interp_option=sixteen_pt+four_pt+average_4pt+search
     240        interp_option=four_pt
     241#        masked=water
     242#        interp_mask=LANDSEA(0)
    218243        fill_missing=285.
    219244        flag_in_output=FLAG_ST100200
    220245========================================
    221246name=ST010200
    222         interp_option=sixteen_pt+four_pt+average_4pt+search
    223         masked=water
    224         interp_mask=LANDSEA(0)
     247#        interp_option=sixteen_pt+four_pt+average_4pt+search
     248        interp_option=four_pt
     249#        masked=water
     250#        interp_mask=LANDSEA(0)
    225251        fill_missing=285.
    226252        flag_in_output=FLAG_ST010200
    227253========================================
    228254name=SM000007
    229         interp_option=sixteen_pt+four_pt+average_4pt+search
     255#        interp_option=sixteen_pt+four_pt+average_4pt+search
     256        interp_option=four_pt
    230257        masked=water
    231258        interp_mask=LANDSEA(0)
     
    371398name=RH
    372399        interp_option=sixteen_pt+four_pt+average_4pt
    373         fill_missing=0.
    374         fill_lev=200100:const(0.)
     400        fill_missing=100.
     401        fill_lev=200100:const(0.)       
    375402========================================
    376403name=TAVGSFC
     
    383410                         #   write the field out as TT
    384411========================================
     412#average_4pt, average_16pt, wt_average_4pt, wt_average_16pt,
     413#nearest_neighbor, four_pt, sixteen_pt, search, average_gcell(r)
     414#
     415#wt_average: bof
     416#average_gcell: bof aussi
    385417name=TT
    386418        mandatory=yes    # MUST HAVE THIS FIELD
    387         interp_option=four_pt+average_4pt
    388         fill_missing=0.
     419#        interp_option=four_pt+average_4pt
     420#careful: inputs from the GCMs are in a "polygonal" world !
     421        interp_option=sixteen_pt+four_pt+average_4pt
     422#        interp_option=sixteen_pt+four_pt
     423        fill_missing=-1.0e+30
     424        missing_value=-9.99e+33
    389425========================================
    390426name=U ; output_name=UU  # If we get U, use entry from UU and
     
    394430        mandatory=yes    # MUST HAVE THIS FIELD
    395431        interp_option=sixteen_pt+four_pt+average_4pt
     432#        interp_option=sixteen_pt+four_pt
    396433        is_u_field=yes
    397434        output_stagger=U
    398         fill_missing=0.
     435        fill_missing=-1.0e+30
     436        missing_value=-9.99e+33
    399437========================================
    400438name=V ; output_name=VV  # If we get V, use entry from VV and
     
    404442        mandatory=yes    # MUST HAVE THIS FIELD
    405443        interp_option=sixteen_pt+four_pt+average_4pt
     444#        interp_option=sixteen_pt+four_pt
    406445        is_v_field=yes
    407446        output_stagger=V
    408         fill_missing=0.
     447        fill_missing=-1.0e+30
     448        missing_value=-9.99e+33
    409449========================================
    410450name=SST
     
    474514========================================
    475515name=SOILHGT
    476         interp_option=four_pt+average_4pt
     516#        interp_option=four_pt+average_4pt
     517#careful: inputs from the GCMs are in a "polygonal" world !
     518        interp_option=sixteen_pt+four_pt+average_4pt
    477519        flag_in_output=FLAG_SOILHGT
    478520========================================
     521name=HV
     522#        mandatory=yes    # MUST HAVE THIS FIELD
     523#        interp_option=sixteen_pt+four_pt+average_4pt
     524#        interp_option=sixteen_pt+four_pt
     525        interp_option=four_pt
     526#        fill_lev=200100:const(0.)
     527        fill_missing=-1.0e+30
     528        missing_value=-9.99e+33
     529========================================
     530name=HI
     531#        mandatory=yes    # MUST HAVE THIS FIELD
     532#        interp_option=sixteen_pt+four_pt+average_4pt
     533#        interp_option=sixteen_pt+four_pt
     534        interp_option=four_pt       
     535#        fill_lev=200100:const(0.)
     536        fill_missing=-1.0e+30
     537        missing_value=-9.99e+33
     538========================================
     539name=TSOIL
     540#        mandatory=yes    # MUST HAVE THIS FIELD
     541#         interp_option=sixteen_pt+four_pt+average_4pt
     542         interp_option=sixteen_pt+four_pt
     543#        fill_lev=200100:const(0.)
     544         fill_missing=-1.0e+30
     545         missing_value=-9.99e+33
     546========================================
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/metgrid/src/module_date_pack.f90

    r11 r12  
    1111!  3. split_date_char ( date , century_year , month , day , hour , minute , second )
    1212!  Given the date, return the integer components.
     13
     14!****************
     15! subroutines are similar to the ones in module_date_time in the WRF share directory
     16!****************
    1317
    1418use module_debug
     
    6872     
    6973      !  Assign the number of days in a months
    70      
    71       mday( 1) = 31
    72       mday( 2) = 28
    73       mday( 3) = 31
    74       mday( 4) = 30
    75       mday( 5) = 31
    76       mday( 6) = 30
    77       mday( 7) = 31
    78       mday( 8) = 31
    79       mday( 9) = 30
    80       mday(10) = 31
    81       mday(11) = 30
    82       mday(12) = 31
     74
     75! months as defined in Martian ESMF routines
     76 
     77      mday( 1) = 61
     78      mday( 2) = 66
     79      mday( 3) = 66
     80      mday( 4) = 65
     81      mday( 5) = 60
     82      mday( 6) = 54
     83      mday( 7) = 50
     84      mday( 8) = 46
     85      mday( 9) = 47
     86      mday(10) = 47
     87      mday(11) = 51
     88      mday(12) = 56
    8389     
    8490      !  Break down old hdate into parts
     
    143149      !  Check that the day of NDATE makes sense.
    144150     
    145       IF (monew.ne.2) THEN
     151!      IF (monew.ne.2) THEN
    146152      ! ...... For all months but February
    147153         IF ((dynew.GT.mday(monew)).or.(dynew.LT.1)) THEN
     
    149155            npass = .false.
    150156         END IF
    151       ELSE IF (monew.eq.2) THEN
    152       ! ...... For February
    153          IF ((dynew.GT.nfeb(yrnew)).OR.(dynew.LT.1)) THEN
    154             PRINT*, 'GETH_IDTS:  Day of NDATE = ', dynew
    155             npass = .false.
    156          END IF
    157       END IF
     157!      ELSE IF (monew.eq.2) THEN
     158!      ! ...... For February
     159!         IF ((dynew.GT.nfeb(yrnew)).OR.(dynew.LT.1)) THEN
     160!            PRINT*, 'GETH_IDTS:  Day of NDATE = ', dynew
     161!            npass = .false.
     162!         END IF
     163!      END IF
    158164     
    159165      !  Check that the day of ODATE makes sense.
    160166     
    161       IF (moold.ne.2) THEN
     167!      IF (moold.ne.2) THEN
    162168      ! ...... For all months but February
    163169         IF ((dyold.GT.mday(moold)).or.(dyold.LT.1)) THEN
     
    165171            opass = .false.
    166172         END IF
    167       ELSE IF (moold.eq.2) THEN
    168       ! ....... For February
    169          IF ((dyold.GT.nfeb(yrold)).or.(dyold.LT.1)) THEN
    170             PRINT*, 'GETH_IDTS:  Day of ODATE = ', dyold
    171             opass = .false.
    172          END IF
    173       END IF
     173!      ELSE IF (moold.eq.2) THEN
     174!      ! ....... For February
     175!         IF ((dyold.GT.nfeb(yrold)).or.(dyold.LT.1)) THEN
     176!            PRINT*, 'GETH_IDTS:  Day of ODATE = ', dyold
     177!            opass = .false.
     178!         END IF
     179!      END IF
    174180     
    175181      !  Check that the hour of NDATE makes sense.
     
    189195      !  Check that the minute of NDATE makes sense.
    190196     
    191       IF ((minew.GT.59).or.(minew.LT.0)) THEN
     197      IF ((minew.GT.36).or.(minew.LT.0)) THEN
    192198         PRINT*, 'GETH_IDTS:  Minute of NDATE = ', minew
    193199         npass = .false.
     
    196202      !  Check that the minute of ODATE makes sense.
    197203     
    198       IF ((miold.GT.59).or.(miold.LT.0)) THEN
     204      IF ((miold.GT.36).or.(miold.LT.0)) THEN
    199205         PRINT*, 'GETH_IDTS:  Minute of ODATE = ', miold
    200206         opass = .false.
     
    203209      !  Check that the second of NDATE makes sense.
    204210     
    205       IF ((scnew.GT.59).or.(scnew.LT.0)) THEN
     211      IF ((scnew.GT.99).or.(scnew.LT.0)) THEN
    206212         PRINT*, 'GETH_IDTS:  SECOND of NDATE = ', scnew
    207213         npass = .false.
     
    210216      !  Check that the second of ODATE makes sense.
    211217     
    212       IF ((scold.GT.59).or.(scold.LT.0)) THEN
     218      IF ((scold.GT.99).or.(scold.LT.0)) THEN
    213219         PRINT*, 'GETH_IDTS:  Second of ODATE = ', scold
    214220         opass = .false.
     
    216222     
    217223      IF (.not. npass) THEN
     224         !WRITE( wrf_err_message , * ) 'module_date_time: geth_idts: Bad NDATE: ', ndate(1:nlen)
     225         !CALL wrf_error_fatal ( TRIM ( wrf_err_message ) )
     226         !****difference with module_date_time
    218227         call mprintf(.true.,ERROR,'Screwy NDATE: %s',s1=ndate(1:nlen))
    219228      END IF
    220229     
    221230      IF (.not. opass) THEN
     231         !WRITE( wrf_err_message , * ) 'module_date_time: geth_idts: Bad ODATE: ', odate(1:olen)
     232         !CALL wrf_error_fatal ( TRIM ( wrf_err_message ) )
     233         !****difference with module_date_time
    222234         call mprintf(.true.,ERROR,'Screwy ODATE: %s',s1=odate(1:olen))
    223235      END IF
     
    231243      newdys = 0
    232244      DO i = yrold, yrnew - 1
    233          newdys = newdys + (365 + (nfeb(i)-28))
     245!         newdys = newdys + (365 + (nfeb(i)-28))
     246! so cool to deal with a planet without any february month :)
     247         newdys = newdys + 669
    234248      END DO
    235249     
    236250      IF (monew .GT. 1) THEN
    237          mday(2) = nfeb(yrnew)
     251!         mday(2) = nfeb(yrnew)
    238252         DO i = 1, monew - 1
    239253            newdys = newdys + mday(i)
    240254         END DO
    241          mday(2) = 28
     255!         mday(2) = 28
    242256      END IF
    243257     
     
    250264     
    251265      IF (moold .GT. 1) THEN
    252          mday(2) = nfeb(yrold)
     266!         mday(2) = nfeb(yrold)
    253267         DO i = 1, moold - 1
    254268            olddys = olddys + mday(i)
    255269         END DO
    256          mday(2) = 28
     270!         mday(2) = 28
    257271      END IF
    258272     
     
    261275      !  Determine the time difference in seconds
    262276     
    263       idts = (newdys - olddys) * 86400
    264       idts = idts + (hrnew - hrold) * 3600
    265       idts = idts + (minew - miold) * 60
     277      idts = (newdys - olddys) * 88800    !martian sols
     278      idts = idts + (hrnew - hrold) * 3700  !hours
     279      idts = idts + (minew - miold) * 100  !minutes
    266280      idts = idts + (scnew - scold)
    267281     
     
    328342      CHARACTER (LEN=10) :: hfrc
    329343      CHARACTER (LEN=1) :: sp
    330       ! INTEGER, EXTERNAL :: nfeb  ! in the same module now
    331 
     344!      INTEGER, EXTERNAL :: nfeb  ! in the same module now
     345     
    332346      !  Assign the number of days in a months
    333      
    334       mday( 1) = 31
    335       mday( 2) = 28
    336       mday( 3) = 31
    337       mday( 4) = 30
    338       mday( 5) = 31
    339       mday( 6) = 30
    340       mday( 7) = 31
    341       mday( 8) = 31
    342       mday( 9) = 30
    343       mday(10) = 31
    344       mday(11) = 30
    345       mday(12) = 31
     347
     348      mday( 1) = 61
     349      mday( 2) = 66
     350      mday( 3) = 66
     351      mday( 4) = 65
     352      mday( 5) = 60
     353      mday( 6) = 54
     354      mday( 7) = 50
     355      mday( 8) = 46
     356      mday( 9) = 47
     357      mday(10) = 47
     358      mday(11) = 51
     359      mday(12) = 56
    346360     
    347361      !  Break down old hdate into parts
     
    377391      END IF
    378392     
    379       !  Set the number of days in February for that year.
    380      
    381       mday(2) = nfeb(yrold)
     393!      !  Set the number of days in February for that year.
     394     
     395!      mday(2) = nfeb(yrold)
    382396     
    383397      !  Check that ODATE makes sense.
     
    408422      !  Check that the minute of ODATE makes sense.
    409423     
    410       IF ((miold.GT.59).or.(miold.LT.0)) THEN
     424      IF ((miold.GT.36).or.(miold.LT.0)) THEN
    411425         WRITE(*,*) 'GETH_NEWDATE:  Minute of ODATE = ', miold
    412426         opass = .FALSE.
     
    415429      !  Check that the second of ODATE makes sense.
    416430     
    417       IF ((scold.GT.59).or.(scold.LT.0)) THEN
     431      IF ((scold.GT.99).or.(scold.LT.0)) THEN
    418432         WRITE(*,*) 'GETH_NEWDATE:  Second of ODATE = ', scold
    419433         opass = .FALSE.
     
    424438     
    425439      IF (.not.opass) THEN
     440         !WRITE( wrf_err_message , * ) 'module_date_time: GETH_NEWDATE: Bad ODATE: ', odate(1:olen), olen
     441         !CALL wrf_error_fatal ( TRIM ( wrf_err_message ) )
     442         !**** difference avec module_date_time
    426443         call mprintf(.true.,ERROR,'GETH_NEWDATE: Crazy ODATE: %s %i',s1=odate(1:olen),i1=olen)
    427444      END IF
     
    435452         ifrc = olen-20
    436453         ifrc = 10**ifrc
    437          nday   = ABS(idt)/(86400*ifrc)
    438          nhour  = MOD(ABS(idt),86400*ifrc)/(3600*ifrc)
    439          nmin   = MOD(ABS(idt),3600*ifrc)/(60*ifrc)
    440          nsec   = MOD(ABS(idt),60*ifrc)/(ifrc)
     454         nday   = ABS(idt)/(88800*ifrc)
     455         nhour  = MOD(ABS(idt),88800*ifrc)/(3700*ifrc)
     456         nmin   = MOD(ABS(idt),3700*ifrc)/(100*ifrc)
     457         nsec   = MOD(ABS(idt),100*ifrc)/(ifrc)
    441458         nfrac = MOD(ABS(idt), ifrc)
    442459      ELSE IF (olen.eq.19) THEN  !idt should be in seconds
    443460         ifrc = 1
    444          nday   = ABS(idt)/86400 ! Integer number of days in delta-time
    445          nhour  = MOD(ABS(idt),86400)/3600
    446          nmin   = MOD(ABS(idt),3600)/60
    447          nsec   = MOD(ABS(idt),60)
     461         nday   = ABS(idt)/88800 ! Integer number of days in delta-time
     462         nhour  = MOD(ABS(idt),88800)/3700
     463         nmin   = MOD(ABS(idt),3700)/100
     464         nsec   = MOD(ABS(idt),100)
    448465         nfrac  = 0
    449466      ELSE IF (olen.eq.16) THEN !idt should be in minutes
    450467         ifrc = 1
    451          nday   = ABS(idt)/1440 ! Integer number of days in delta-time
    452          nhour  = MOD(ABS(idt),1440)/60
    453          nmin   = MOD(ABS(idt),60)
     468         nday   = ABS(idt)/2400 ! Integer number of days in delta-time
     469         nhour  = MOD(ABS(idt),2400)/100
     470         nmin   = MOD(ABS(idt),100)
    454471         nsec   = 0
    455472         nfrac  = 0
     
    469486         nfrac  = 0
    470487      ELSE
     488         !WRITE( wrf_err_message , * ) 'module_date_time: GETH_NEWDATE: Strange length for ODATE: ',olen
     489         !CALL wrf_error_fatal ( TRIM ( wrf_err_message ) )
     490         !**** difference with module_date_time
    471491         call mprintf(.true.,ERROR,'GETH_NEWDATE: Strange length for ODATE: %i',i1=olen)
    472492      END IF
     
    481501     
    482502         scnew = scold + nsec
    483          IF (scnew .GE. 60) THEN
    484             scnew = scnew - 60
     503         IF (scnew .GE. 100) THEN
     504            scnew = scnew - 100
    485505            nmin  = nmin + 1
    486506         END IF
    487507     
    488508         minew = miold + nmin
    489          IF (minew .GE. 60) THEN
    490             minew = minew - 60
     509         IF (minew .GE. 37) THEN
     510            minew = minew - 37
    491511            nhour  = nhour + 1
    492512         END IF
     
    509529                  monew = 1
    510530                  yrnew = yrnew + 1
    511                   ! If the year changes, recompute the number of days in February
    512                   mday(2) = nfeb(yrnew)
     531                  !! If the year changes, recompute the number of days in February
     532                  !mday(2) = nfeb(yrnew)
    513533               END IF
    514534            END IF
     
    525545         scnew = scold - nsec
    526546         IF (scnew .LT. 00) THEN
    527             scnew = scnew + 60
     547            scnew = scnew + 100
    528548            nmin  = nmin + 1
    529549         END IF
     
    531551         minew = miold - nmin
    532552         IF (minew .LT. 00) THEN
    533             minew = minew + 60
     553            minew = minew + 37
    534554            nhour  = nhour + 1
    535555         END IF
     
    551571                  monew = 12
    552572                  yrnew = yrnew - 1
    553                   ! If the year changes, recompute the number of days in February
    554                   mday(2) = nfeb(yrnew)
     573                  !! If the year changes, recompute the number of days in February
     574                  !mday(2) = nfeb(yrnew)
    555575               END IF
    556576               dynew = mday(monew)
     
    593613!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    594614
    595    FUNCTION nfeb ( year ) RESULT (num_days)
    596    
    597       ! Compute the number of days in February for the given year
    598    
    599       IMPLICIT NONE
    600    
    601       INTEGER :: year
    602       INTEGER :: num_days
    603    
    604       num_days = 28 ! By default, February has 28 days ...
    605       IF (MOD(year,4).eq.0) THEN 
    606          num_days = 29  ! But every four years, it has 29 days ...
    607          IF (MOD(year,100).eq.0) THEN
    608             num_days = 28  ! Except every 100 years, when it has 28 days ...
    609             IF (MOD(year,400).eq.0) THEN
    610                num_days = 29  ! Except every 400 years, when it has 29 days.
    611             END IF
    612          END IF
    613       END IF
    614    
    615    END FUNCTION nfeb
     615!   FUNCTION nfeb ( year ) RESULT (num_days)
     616!   
     617!      ! Compute the number of days in February for the given year
     618!   
     619!      IMPLICIT NONE
     620!   
     621!      INTEGER :: year
     622!      INTEGER :: num_days
     623!
     624!        num_days = 99999
     625!        PRINT *, 'WARNING !' 
     626!! normally never called ...       
     627
     628!!      num_days = 28 ! By default, February has 28 days ...
     629!!      IF (MOD(year,4).eq.0) THEN 
     630!!         num_days = 29  ! But every four years, it has 29 days ...
     631!!         IF (MOD(year,100).eq.0) THEN
     632!!            num_days = 28  ! Except every 100 years, when it has 28 days ...
     633!!            IF (MOD(year,400).eq.0) THEN
     634!!               num_days = 29  ! Except every 400 years, when it has 29 days.
     635!!            END IF
     636!!         END IF
     637!!      END IF
     638!   
     639!   END FUNCTION nfeb
    616640
    617641!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    623647   
    624648      CHARACTER(LEN=19) , INTENT(IN) :: date
    625   
     649 
    626650      !  Output data.
    627651   
     
    636660   
    637661   END SUBROUTINE split_date_char
    638    
     662
    639663END MODULE date_pack
  • trunk/mesoscale/LMD_MM_MARS/SRC/WPS/metgrid/src/process_domain_module.F90

    r11 r12  
    106106   
    107107         call geth_newdate(valid_date, trim(start_date(n)), t*interval_seconds)
     108
     109         print *,'now working on ...'       
     110         print *,valid_date
     111
    108112         temp_date = ' '
    109113
    110          if (mod(interval_seconds,3600) == 0) then
    111             write(temp_date,'(a13)') valid_date(1:10)//'_'//valid_date(12:13)
    112          else if (mod(interval_seconds,60) == 0) then
    113             write(temp_date,'(a16)') valid_date(1:10)//'_'//valid_date(12:16)
    114          else
     114!*****MARS !!!
     115!         if (mod(interval_seconds,3700) == 0) then
     116!            write(temp_date,'(a13)') valid_date(1:10)//'_'//valid_date(12:13)
     117!         else if (mod(interval_seconds,100) == 0) then
     118!            write(temp_date,'(a16)') valid_date(1:10)//'_'//valid_date(12:16)
     119!         else
    115120            write(temp_date,'(a19)') valid_date(1:10)//'_'//valid_date(12:19)
    116          end if
     121!         end if
    117122   
    118123         call mprintf(.true.,STDOUT, ' Processing %s', s1=trim(temp_date))
     
    726731                           met_dy = abs(deltalat)
    727732                        else
     733!
     734! MARS MARS: BEWARE WITH THAT PART !
     735!
    728736! BUG: Need to more correctly handle dx/dy in meters.
    729737                           met_dx = met_dx / 111000.  ! Convert meters to approximate degrees
Note: See TracChangeset for help on using the changeset viewer.