Defining Leap years

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Fri Jan 5 15:39:11 EST 2007


You could try using the math function in the script.

rc = math_mod(num1,num2);

      num1       any number
      num2       any number not equal to zero
      rc         the integer part of the remainder when num1 is divided
by num2

num1 = year
num2 = 4
rc = 0 if year is evenly divisible by 4.

Katherin Kullgren wrote:
> Hello there,
> I am wondering if anyone could assist me.  I am trying to write daily data
> into one file from many year files.  I am trying to use a (if then)
> statement to define the files that contain a leap year.  Something like this
>
> year = 1950
> endday = 365
> leap = 366
>
>
>
> while (pfile <= 50)
> ..
> ..
> ..
> if (year/4 = real(year)/4.0) then
> while (t <= endday)
> ..
> ..
> ..
> endwhile
> else
> while (t <= leap)
> ..
> ..
> ..
> endwhile
> endif
>
> pfile = pfile + 1
> endwhile
>
> but the format is not the same as fortran.  It does not understand
> real(year).  Can anyone make a suggestion on how to define the leap year files?
> Thanks for your help in advance.
> Katherin
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mary-Jo.Nath.vcf
Type: text/x-vcard
Size: 217 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20070105/8824a584/attachment.vcf 


More information about the gradsusr mailing list