37 |
c - Alternatively: transfer writing of scale files to |
c - Alternatively: transfer writing of scale files to |
38 |
c ctrl_unpack |
c ctrl_unpack |
39 |
c |
c |
40 |
|
c Dimitris Menemenlis menemenlis@mit.edu 7-Mar-2003 |
41 |
|
c - To be consistent with usage in ctrl_getrec.F, |
42 |
|
c startrec and endrec need to be referenced to |
43 |
|
c model time = 0, not to startTime. |
44 |
|
c Also "- modelstep" -> "+ modelstep/2": |
45 |
|
c old: startrec = int((modelstart - diffsecs)/ |
46 |
|
c old: & xx_???period) + 1 |
47 |
|
c old: endrec = int((modelend - diffsecs - modelstep)/ |
48 |
|
c old: & xx_???period) + 2 |
49 |
|
c new: startrec = int((modelstart + startTime - diffsecs)/ |
50 |
|
c new: & xx_???period) + 1 |
51 |
|
c new: endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
52 |
|
c new: & xx_???period) + 2 |
53 |
|
c |
54 |
c ================================================================== |
c ================================================================== |
55 |
c SUBROUTINE ctrl_init |
c SUBROUTINE ctrl_init |
56 |
c ================================================================== |
c ================================================================== |
375 |
call cal_TimePassed( xx_hfluxstartdate, modelstartdate, |
call cal_TimePassed( xx_hfluxstartdate, modelstartdate, |
376 |
& difftime, mythid ) |
& difftime, mythid ) |
377 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
378 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
379 |
& xx_hfluxperiod) + 1 |
& xx_hfluxperiod) + 1 |
380 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
381 |
& xx_hfluxperiod) + 2 |
& xx_hfluxperiod) + 2 |
382 |
ivarindex = 3 |
ivarindex = 3 |
383 |
ncvarindex(ivarindex) = 103 |
ncvarindex(ivarindex) = 103 |
397 |
call cal_TimePassed( xx_atempstartdate, modelstartdate, |
call cal_TimePassed( xx_atempstartdate, modelstartdate, |
398 |
& difftime, mythid ) |
& difftime, mythid ) |
399 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
400 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
401 |
& xx_atempperiod) + 1 |
& xx_atempperiod) + 1 |
402 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
403 |
& xx_atempperiod) + 2 |
& xx_atempperiod) + 2 |
404 |
ivarindex = 7 |
ivarindex = 7 |
405 |
ncvarindex(ivarindex) = 107 |
ncvarindex(ivarindex) = 107 |
421 |
call cal_TimePassed( xx_sfluxstartdate, modelstartdate, |
call cal_TimePassed( xx_sfluxstartdate, modelstartdate, |
422 |
& difftime, mythid ) |
& difftime, mythid ) |
423 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
424 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
425 |
& xx_sfluxperiod) + 1 |
& xx_sfluxperiod) + 1 |
426 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
427 |
& xx_sfluxperiod) + 2 |
& xx_sfluxperiod) + 2 |
428 |
ivarindex = 4 |
ivarindex = 4 |
429 |
ncvarindex(ivarindex) = 104 |
ncvarindex(ivarindex) = 104 |
443 |
call cal_TimePassed( xx_aqhstartdate, modelstartdate, |
call cal_TimePassed( xx_aqhstartdate, modelstartdate, |
444 |
& difftime, mythid ) |
& difftime, mythid ) |
445 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
446 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
447 |
& xx_aqhperiod) + 1 |
& xx_aqhperiod) + 1 |
448 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
449 |
& xx_aqhperiod) + 2 |
& xx_aqhperiod) + 2 |
450 |
ivarindex = 8 |
ivarindex = 8 |
451 |
ncvarindex(ivarindex) = 108 |
ncvarindex(ivarindex) = 108 |
467 |
call cal_TimePassed( xx_tauustartdate, modelstartdate, |
call cal_TimePassed( xx_tauustartdate, modelstartdate, |
468 |
& difftime, mythid ) |
& difftime, mythid ) |
469 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
470 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
471 |
& xx_tauuperiod) + 1 |
& xx_tauuperiod) + 1 |
472 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
473 |
& xx_tauuperiod) + 2 |
& xx_tauuperiod) + 2 |
474 |
ivarindex = 5 |
ivarindex = 5 |
475 |
ncvarindex(ivarindex) = 105 |
ncvarindex(ivarindex) = 105 |
489 |
call cal_TimePassed( xx_uwindstartdate, modelstartdate, |
call cal_TimePassed( xx_uwindstartdate, modelstartdate, |
490 |
& difftime, mythid ) |
& difftime, mythid ) |
491 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
492 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
493 |
& xx_uwindperiod) + 1 |
& xx_uwindperiod) + 1 |
494 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
495 |
& xx_uwindperiod) + 2 |
& xx_uwindperiod) + 2 |
496 |
ivarindex = 9 |
ivarindex = 9 |
497 |
ncvarindex(ivarindex) = 109 |
ncvarindex(ivarindex) = 109 |
513 |
call cal_TimePassed( xx_tauvstartdate, modelstartdate, |
call cal_TimePassed( xx_tauvstartdate, modelstartdate, |
514 |
& difftime, mythid ) |
& difftime, mythid ) |
515 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
516 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
517 |
& xx_tauvperiod) + 1 |
& xx_tauvperiod) + 1 |
518 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
519 |
& xx_tauvperiod) + 2 |
& xx_tauvperiod) + 2 |
520 |
ivarindex = 6 |
ivarindex = 6 |
521 |
ncvarindex(ivarindex) = 106 |
ncvarindex(ivarindex) = 106 |
535 |
call cal_TimePassed( xx_vwindstartdate, modelstartdate, |
call cal_TimePassed( xx_vwindstartdate, modelstartdate, |
536 |
& difftime, mythid ) |
& difftime, mythid ) |
537 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
538 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
539 |
& xx_vwindperiod) + 1 |
& xx_vwindperiod) + 1 |
540 |
endrec = int((modelend - diffsecs - modelstep)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
541 |
& xx_vwindperiod) + 2 |
& xx_vwindperiod) + 2 |
542 |
ivarindex = 10 |
ivarindex = 10 |
543 |
ncvarindex(ivarindex) = 110 |
ncvarindex(ivarindex) = 110 |
559 |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
call cal_TimePassed( xx_obcsnstartdate, modelstartdate, |
560 |
& difftime, mythid ) |
& difftime, mythid ) |
561 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
562 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
563 |
& xx_obcsnperiod) + 1 |
& xx_obcsnperiod) + 1 |
564 |
endrec = int((modelend - diffsecs)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
565 |
& xx_obcsnperiod) + 2 |
& xx_obcsnperiod) + 2 |
566 |
ivarindex = 11 |
ivarindex = 11 |
567 |
ncvarindex(ivarindex) = 111 |
ncvarindex(ivarindex) = 111 |
583 |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
call cal_TimePassed( xx_obcssstartdate, modelstartdate, |
584 |
& difftime, mythid ) |
& difftime, mythid ) |
585 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
586 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
587 |
& xx_obcssperiod) + 1 |
& xx_obcssperiod) + 1 |
588 |
endrec = int((modelend - diffsecs)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
589 |
& xx_obcssperiod) + 2 |
& xx_obcssperiod) + 2 |
590 |
ivarindex = 12 |
ivarindex = 12 |
591 |
ncvarindex(ivarindex) = 112 |
ncvarindex(ivarindex) = 112 |
607 |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
call cal_TimePassed( xx_obcswstartdate, modelstartdate, |
608 |
& difftime, mythid ) |
& difftime, mythid ) |
609 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
610 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
611 |
& xx_obcswperiod) + 1 |
& xx_obcswperiod) + 1 |
612 |
endrec = int((modelend - diffsecs)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
613 |
& xx_obcswperiod) + 2 |
& xx_obcswperiod) + 2 |
614 |
ivarindex = 13 |
ivarindex = 13 |
615 |
ncvarindex(ivarindex) = 113 |
ncvarindex(ivarindex) = 113 |
631 |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
call cal_TimePassed( xx_obcsestartdate, modelstartdate, |
632 |
& difftime, mythid ) |
& difftime, mythid ) |
633 |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
call cal_ToSeconds ( difftime, diffsecs, mythid ) |
634 |
startrec = int((modelstart - diffsecs)/ |
startrec = int((modelstart + startTime - diffsecs)/ |
635 |
& xx_obcseperiod) + 1 |
& xx_obcseperiod) + 1 |
636 |
endrec = int((modelend - diffsecs)/ |
endrec = int((modelend + startTime - diffsecs + modelstep/2)/ |
637 |
& xx_obcseperiod) + 2 |
& xx_obcseperiod) + 2 |
638 |
ivarindex = 14 |
ivarindex = 14 |
639 |
ncvarindex(ivarindex) = 114 |
ncvarindex(ivarindex) = 114 |