- Timestamp:
- 10/21/08 14:35:32 (16 years ago)
- Location:
- IOIPSL/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
IOIPSL/trunk/src/calendar.f90
r386 r428 651 651 !--------------------------------------------------------------------- 652 652 !- 653 ! Clean up the s ring !653 ! Clean up the string ! 654 654 !- 655 655 str_w = str … … 701 701 ENDIF 702 702 END SELECT 703 ELSE 703 ELSE IF (TRIM(str_w) /= TRIM(calendar_used)) THEN 704 704 WRITE(str_w,'(f10.4)') one_year 705 705 CALL ipslerr (2,'ioconf_calendar', & 706 & 'The calendar was already used or configured. You are not', & 707 & 'allowed to change it again. '// & 708 & 'The following length of year is used : ',TRIM(ADJUSTL(str_w))) 706 & 'The calendar was already used or configured to : '// & 707 & TRIM(calendar_used)//'.', & 708 & 'You are not allowed to change it to : '//TRIM(str)//'.', & 709 & 'The following length of year is used : '//TRIM(ADJUSTL(str_w))) 709 710 ENDIF 710 711 !----------------------------- -
IOIPSL/trunk/src/restcom.f90
r386 r428 8 8 USE netcdf 9 9 !- 10 USE errioipsl, ONLY : ipslerr 10 USE errioipsl, ONLY : ipslerr,ipsldbg 11 11 USE stringop 12 12 USE calendar … … 212 212 INTEGER,INTENT(IN),OPTIONAL :: domain_id 213 213 !- 214 ! LOCAL215 !-216 214 INTEGER :: ncfid 217 215 REAL :: dt_tmp,date0_tmp … … 219 217 LOGICAL :: overwrite_time 220 218 CHARACTER(LEN=120) :: fname 221 LOGICAL :: check = .FALSE. 222 !--------------------------------------------------------------------- 219 LOGICAL :: l_dbg 220 !--------------------------------------------------------------------- 221 CALL ipsldbg (old_status=l_dbg) 223 222 !- 224 223 ! 0.0 Prepare the configuration before opening any files … … 230 229 ENDIF 231 230 !- 232 IF ( check) THEN231 IF (l_dbg) THEN 233 232 WRITE(*,*) 'restini 0.0 : ',TRIM(fnamein),' , ',TRIM(fnameout) 234 233 ENDIF … … 254 253 l_rw = l_fi.AND.l_fo.AND.(TRIM(fnamein) == TRIM(fnameout)) 255 254 !- 256 IF ( check) THEN255 IF (l_dbg) THEN 257 256 WRITE(*,*) 'restini 0.1 l_fi, l_fo, l_rw : ',l_fi,l_fo,l_rw 258 257 ENDIF … … 262 261 IF (l_fi) THEN 263 262 !--- 264 IF ( check) WRITE(*,*) 'restini 1.0 : Open input file'263 IF (l_dbg) WRITE(*,*) 'restini 1.0 : Open input file' 265 264 !-- Add DOMAIN number and ".nc" suffix in file names if needed 266 265 fname = fnamein … … 285 284 !-- 2.0 The case of a missing restart file is dealt with 286 285 !--- 287 IF ( check) WRITE(*,*) 'restini 2.0'286 IF (l_dbg) WRITE(*,*) 'restini 2.0' 288 287 !--- 289 288 IF ( (ALL(MINLOC(lon(:iim,:jjm)) == MAXLOC(lon(:iim,:jjm)))) & … … 312 311 !--- 313 312 tax_size_in(nb_fi) = 1 314 CALL rest_atim ( check,'restini')313 CALL rest_atim (l_dbg,'restini') 315 314 t_index(nb_fi,1) = itau 316 315 t_julian(nb_fi,1) = date0 … … 340 339 ! (to be modified in ioconf_calendar) 341 340 !- 342 IF ( check) THEN341 IF (l_dbg) THEN 343 342 WRITE(*,*) 'restini 2.3 : Configure calendar if needed : ', & 344 343 calend_str … … 347 346 IF (INDEX(calend_str,'unknown') < 1) THEN 348 347 CALL ioconf_calendar (calend_str) 349 IF ( check) THEN348 IF (l_dbg) THEN 350 349 WRITE(*,*) 'restini 2.3b : new calendar : ',calend_str 351 350 ENDIF … … 359 358 !- 360 359 fid = nb_fi 361 IF ( check) THEN360 IF (l_dbg) THEN 362 361 WRITE(*,*) 'SIZE of t_index :',SIZE(t_index), & 363 362 SIZE(t_index,dim=1),SIZE(t_index,dim=2) … … 366 365 itau = t_index(fid,1) 367 366 !- 368 IF ( check) WRITE(*,*) 'restini END'367 IF (l_dbg) WRITE(*,*) 'restini END' 369 368 !--------------------- 370 369 END SUBROUTINE restini … … 387 386 LOGICAL,INTENT(IN) :: l_rw 388 387 INTEGER,INTENT(OUT) :: ncfid 389 !-390 ! LOCAL391 388 !- 392 389 INTEGER,DIMENSION(max_dim) :: var_dims,dimlen … … 399 396 CHARACTER(LEN=80) :: units 400 397 CHARACTER(LEN=NF90_max_name),DIMENSION(max_dim) :: dimname 401 LOGICAL :: check = .FALSE. 402 !--------------------------------------------------------------------- 398 LOGICAL :: l_dbg 399 !--------------------------------------------------------------------- 400 CALL ipsldbg (old_status=l_dbg) 403 401 !- 404 402 ! If we reuse the same file for input and output … … 411 409 ENDIF 412 410 !- 413 IF ( check) WRITE (*,*) "restopenin 0.0 ",TRIM(fname)411 IF (l_dbg) WRITE (*,*) "restopenin 0.0 ",TRIM(fname) 414 412 iret = NF90_INQUIRE(ncfid,nDimensions=nb_dim, & 415 413 & nVariables=nb_var,unlimitedDimId=id_unl) … … 435 433 iret = NF90_INQUIRE_DIMENSION(ncfid,id, & 436 434 & len=dimlen(id),name=dimname(id)) 437 IF ( check) THEN435 IF (l_dbg) THEN 438 436 WRITE (*,*) "restopenin 0.0 dimname",id,TRIM(dimname(id)) 439 437 ENDIF 440 438 IF (TRIM(dimname(id)) == 'x') THEN 441 439 iread = dimlen(id) 442 IF ( check) WRITE (*,*) "iread",iread440 IF (l_dbg) WRITE (*,*) "iread",iread 443 441 ELSE IF (TRIM(dimname(id)) == 'y') THEN 444 442 jread = dimlen(id) 445 IF ( check) WRITE (*,*) "jread",jread443 IF (l_dbg) WRITE (*,*) "jread",jread 446 444 ELSE IF (TRIM(dimname(id)) == 'z') THEN 447 445 lread = dimlen(id) 448 IF ( check) WRITE (*,*) "lread",lread446 IF (l_dbg) WRITE (*,*) "lread",lread 449 447 ENDIF 450 448 ENDDO … … 460 458 itau_out(fid) = -1 461 459 tdimid_out(fid) = tdimid_in(fid) 462 IF ( check) THEN460 IF (l_dbg) THEN 463 461 WRITE (*,*) & 464 462 & "restopenin 0.0 unlimited axis dimname", & … … 504 502 ! 2.0 Get the list of variables 505 503 !- 506 IF ( check) WRITE(*,*) 'restopenin 1.2'504 IF (l_dbg) WRITE(*,*) 'restopenin 1.2' 507 505 !- 508 506 lat_vid = -1 … … 549 547 !-- 2.3 Catch longitude and latitude variables 550 548 !--- 551 IF (INDEX(units,'degrees_nort') >= 1) THEN549 IF (INDEX(units,'degrees_nort') > 0) THEN 552 550 lat_vid = iv 553 ENDIF 554 IF (INDEX(units,'degrees_east') >= 1) THEN 551 ELSE IF (INDEX(units,'degrees_east') > 0) THEN 555 552 lon_vid = iv 556 553 ENDIF … … 635 632 LOGICAL,OPTIONAL :: owrite_time_in 636 633 !- 637 ! LOCAL638 !-639 634 INTEGER :: ncfid,iret,it,iax,iv 640 635 CHARACTER(LEN=80) :: itau_orig,tax_orig,calendar … … 644 639 CHARACTER :: strc 645 640 LOGICAL :: ow_time 646 !- 647 LOGICAL :: check = .FALSE. 648 !--------------------------------------------------------------------- 641 LOGICAL :: l_dbg 642 !--------------------------------------------------------------------- 643 CALL ipsldbg (old_status=l_dbg) 644 !- 649 645 IF (PRESENT(owrite_time_in)) THEN 650 646 ow_time = owrite_time_in … … 657 653 ! Allocate the space we need for the time axes 658 654 !- 659 CALL rest_atim ( check,'restsett')655 CALL rest_atim (l_dbg,'restsett') 660 656 !- 661 657 ! Get the calendar if possible. Else it will be gregorian. … … 665 661 IF (iret == NF90_NOERR) THEN 666 662 CALL ioconf_calendar (calendar) 667 IF ( check) THEN663 IF (l_dbg) THEN 668 664 WRITE(*,*) 'restsett : calendar of the restart ',calendar 669 665 ENDIF … … 671 667 ENDIF 672 668 CALL ioget_calendar (one_year,one_day) 673 IF ( check) THEN669 IF (l_dbg) THEN 674 670 WRITE(*,*) 'one_year,one_day = ',one_year,one_day 675 671 ENDIF … … 683 679 IF (ow_time) THEN 684 680 t_index(nb_fi,:) = itau 685 IF ( check) THEN681 IF (l_dbg) THEN 686 682 WRITE(*,*) "nb_fi,t_index",nb_fi,t_index(nb_fi,:) 687 683 ENDIF … … 693 689 seci = NINT(sec0) 694 690 strc=':' 695 IF ( check) THEN691 IF (l_dbg) THEN 696 692 WRITE(*,*) date0 697 693 WRITE (UNIT=itau_orig,FMT='(I4.4,5(A,I2.2))') & … … 701 697 ELSE 702 698 iret = NF90_GET_VAR(ncfid,tind_varid_in(nb_fi),t_index(nb_fi,:)) 703 IF ( check) THEN699 IF (l_dbg) THEN 704 700 WRITE(*,*) "restsett, time axis : ",t_index(nb_fi,:) 705 701 ENDIF … … 728 724 tax_orig = tax_orig(INDEX(tax_orig,'since')+6:LEN_TRIM(tax_orig)) 729 725 iret = NF90_GET_ATT(ncfid,tax_varid_in(nb_fi),'calendar',tmp_cal) 730 IF ( check) THEN726 IF (l_dbg) THEN 731 727 WRITE(*,*) 'restsett : tmp_calendar of the restart ',tmp_cal 732 728 ENDIF 733 729 !--- 734 730 CALL strlowercase (tmp_cal) 735 IF (INDEX(calend_str,tmp_cal) < 0) THEN731 IF (INDEX(calend_str,tmp_cal) < 1) THEN 736 732 IF (INDEX(calend_str,'unknown') > 0) THEN 737 733 calend_str = tmp_cal … … 746 742 !-- to get ride of the intial date. 747 743 !--- 748 IF ( check) WRITE(*,*) 'tax_orig : ',TRIM(tax_orig)744 IF (l_dbg) WRITE(*,*) 'tax_orig : ',TRIM(tax_orig) 749 745 READ (UNIT=tax_orig,FMT='(I4.4,5(a,I2.2))') & 750 746 year0,strc,month0,strc,day0,strc, & … … 757 753 !- 758 754 IF ( (INDEX(itau_orig,'XXXXX') > 0) & 759 .AND.(INDEX(tax_orig,'XXXXX') < 0) ) THEN755 .AND.(INDEX(tax_orig,'XXXXX') < 1) ) THEN 760 756 !!- Compute the t_itau from the date read and the timestep in the input 761 757 ENDIF 762 758 !- 763 759 IF ( (INDEX(tax_orig,'XXXXX') > 0) & 764 .AND.(INDEX(itau_orig,'XXXXX') < 0) ) THEN760 .AND.(INDEX(itau_orig,'XXXXX') < 1) ) THEN 765 761 DO it=1,tax_size_in(nb_fi) 766 762 t_julian(nb_fi,it) = itau2date(t_index(nb_fi,it),date0,timestep) … … 819 815 INTEGER,INTENT(IN),OPTIONAL :: domain_id 820 816 !- 821 ! LOCAL822 !-823 817 INTEGER :: iret 824 818 CHARACTER(LEN=70) :: str_t … … 831 825 'JUL','AUG','SEP','OCT','NOV','DEC'/) 832 826 CHARACTER(LEN=30) :: timenow 833 LOGICAL :: check = .FALSE. 834 !--------------------------------------------------------------------- 835 IF (check) WRITE(*,*) "restopenout 0.0 ",TRIM(fname) 827 LOGICAL :: l_dbg 828 !--------------------------------------------------------------------- 829 CALL ipsldbg (old_status=l_dbg) 830 !- 831 IF (l_dbg) WRITE(*,*) "restopenout 0.0 ",TRIM(fname) 836 832 !- 837 833 ! If we use the same file for input and output … … 865 861 ! 1.0 Longitude 866 862 !- 867 IF ( check) WRITE(*,*) "restopenout 1.0"863 IF (l_dbg) WRITE(*,*) "restopenout 1.0" 868 864 !- 869 865 iret = NF90_DEF_VAR(ncfid,"nav_lon",NF90_FLOAT,(/x_id,y_id/),nlonid) … … 875 871 ! 2.0 Latitude 876 872 !- 877 IF ( check) WRITE(*,*) "restopenout 2.0"873 IF (l_dbg) WRITE(*,*) "restopenout 2.0" 878 874 !- 879 875 iret = NF90_DEF_VAR(ncfid,"nav_lat",NF90_FLOAT,(/x_id,y_id/),nlatid) … … 885 881 ! 3.0 Levels 886 882 !- 887 IF ( check) WRITE(*,*) "restopenout 3.0"883 IF (l_dbg) WRITE(*,*) "restopenout 3.0" 888 884 !- 889 885 iret = NF90_DEF_VAR(ncfid,"nav_lev",NF90_FLOAT,z_id,nlevid) … … 897 893 ! 4.0 Time axis, this is the seconds since axis 898 894 !- 899 IF ( check) WRITE(*,*) "restopenout 4.0"895 IF (l_dbg) WRITE(*,*) "restopenout 4.0" 900 896 !- 901 897 iret = NF90_DEF_VAR(ncfid,"time",NF90_FLOAT, & … … 925 921 ! 5.0 Time axis, this is the time steps since axis 926 922 !- 927 IF ( check) WRITE(*,*) "restopenout 5.0"923 IF (l_dbg) WRITE(*,*) "restopenout 5.0" 928 924 !- 929 925 iret = NF90_DEF_VAR(ncfid,"time_steps",NF90_INT, & … … 986 982 iret = NF90_REDEF(ncfid) 987 983 !- 988 IF ( check) WRITE(*,*) "restopenout END"984 IF (l_dbg) WRITE(*,*) "restopenout END" 989 985 !------------------------- 990 986 END SUBROUTINE restopenout … … 1008 1004 INTEGER :: nbindex,ijndex(nbindex) 1009 1005 !- 1010 ! LOCAL1011 !-1012 1006 INTEGER :: req_sz,siz1 1013 1007 REAL :: scal 1014 1008 CHARACTER(LEN=7) :: topp 1015 LOGICAL :: check = .FALSE. 1016 !--------------------------------------------------------------------- 1009 LOGICAL :: l_dbg 1010 !--------------------------------------------------------------------- 1011 CALL ipsldbg (old_status=l_dbg) 1017 1012 !- 1018 1013 ! 0.0 What size should be the data in the file … … 1033 1028 !- 1034 1029 siz1 = SIZE(var) 1035 CALL rest_alloc (1,siz1, check,'restget_opp_r1d')1036 CALL rest_alloc (2,req_sz, check,'restget_opp_r1d')1030 CALL rest_alloc (1,siz1,l_dbg,'restget_opp_r1d') 1031 CALL rest_alloc (2,req_sz,l_dbg,'restget_opp_r1d') 1037 1032 !- 1038 1033 ! 2.0 Here we get the variable from the restart file … … 1078 1073 INTEGER :: nbindex,ijndex(nbindex) 1079 1074 !- 1080 ! LOCAL1081 !-1082 1075 INTEGER :: jj,req_sz,ist,var_sz,siz1 1083 1076 REAL :: scal 1084 1077 CHARACTER(LEN=7) :: topp 1085 LOGICAL :: check = .FALSE. 1086 !--------------------------------------------------------------------- 1078 LOGICAL :: l_dbg 1079 !--------------------------------------------------------------------- 1080 CALL ipsldbg (old_status=l_dbg) 1087 1081 !- 1088 1082 ! 0.0 What size should be the data in the file … … 1108 1102 !- 1109 1103 siz1 = SIZE(var,1) 1110 CALL rest_alloc (1,siz1, check,'restget_opp_r2d')1111 CALL rest_alloc (2,req_sz*jjm, check,'restget_opp_r2d')1104 CALL rest_alloc (1,siz1,l_dbg,'restget_opp_r2d') 1105 CALL rest_alloc (2,req_sz*jjm,l_dbg,'restget_opp_r2d') 1112 1106 !- 1113 1107 ! 2.0 Here we get the full variable from the restart file … … 1152 1146 REAL :: var(:) 1153 1147 !- 1154 ! LOCAL1155 !-1156 1148 INTEGER :: ji,jl,req_sz,var_sz,siz1 1157 1149 CHARACTER(LEN=70) :: str,str2 1158 LOGICAL :: check = .FALSE. 1159 !--------------------------------------------------------------------- 1150 LOGICAL :: l_dbg 1151 !--------------------------------------------------------------------- 1152 CALL ipsldbg (old_status=l_dbg) 1160 1153 !- 1161 1154 ! 1.0 Allocate the temporary buffer we need … … 1164 1157 siz1 = SIZE(var) 1165 1158 var_sz = siz1 1166 CALL rest_alloc (1,var_sz, check,'restget_r1d')1159 CALL rest_alloc (1,var_sz,l_dbg,'restget_r1d') 1167 1160 !- 1168 1161 ! 2.0 Here we could check if the sizes specified agree … … 1216 1209 REAL :: var(:,:) 1217 1210 !- 1218 ! LOCAL1219 !-1220 1211 INTEGER :: ji,jj,jl,req_sz,var_sz,siz1,siz2 1221 1212 CHARACTER(LEN=70) :: str,str2 1222 LOGICAL :: check = .FALSE. 1223 !--------------------------------------------------------------------- 1213 LOGICAL :: l_dbg 1214 !--------------------------------------------------------------------- 1215 CALL ipsldbg (old_status=l_dbg) 1224 1216 !- 1225 1217 ! 1.0 Allocate the temporary buffer we need … … 1229 1221 siz2 = SIZE(var,2) 1230 1222 var_sz = siz1*siz2 1231 CALL rest_alloc (1,var_sz, check,'restget_r2d')1223 CALL rest_alloc (1,var_sz,l_dbg,'restget_r2d') 1232 1224 !- 1233 1225 ! 2.0 Here we check if the sizes specified agree … … 1284 1276 REAL :: var(:,:,:) 1285 1277 !- 1286 ! LOCAL1287 !-1288 1278 INTEGER :: ji,jj,jk,jl,req_sz,var_sz,siz1,siz2,siz3 1289 1279 CHARACTER(LEN=70) :: str,str2 1290 LOGICAL :: check = .FALSE. 1291 !--------------------------------------------------------------------- 1280 LOGICAL :: l_dbg 1281 !--------------------------------------------------------------------- 1282 CALL ipsldbg (old_status=l_dbg) 1292 1283 !- 1293 1284 ! 1.0 Allocate the temporary buffer we need … … 1298 1289 siz3 = SIZE(var,3) 1299 1290 var_sz = siz1*siz2*siz3 1300 CALL rest_alloc (1,var_sz, check,'restget_r3d')1291 CALL rest_alloc (1,var_sz,l_dbg,'restget_r3d') 1301 1292 !- 1302 1293 ! 2.0 Here we check if the sizes specified agree … … 1375 1366 REAL :: var(:) 1376 1367 !- 1377 ! LOCAL 1378 !- 1379 INTEGER :: vid,vnb,ncfid 1380 INTEGER :: iret,index,it,ndim,ia 1368 INTEGER :: vid,vnb,ncfid,iret,index,it,ndim,ia 1381 1369 CHARACTER(LEN=70) str,str2 1382 1370 CHARACTER(LEN=80) attname 1383 1371 INTEGER,DIMENSION(4) :: corner,edge 1384 1372 !--------------------------------------------------------------------- 1385 !-1386 1373 ncfid = netcdf_id(fid,1) 1387 1374 !- … … 1443 1430 IF (t_index(fid,it) == itau) index = it 1444 1431 ENDDO 1445 !---1446 1432 IF (index < 0) THEN 1447 1433 str = 'The time step requested for variable '//TRIM(vname_q) … … 1546 1532 INTEGER :: nbindex,ijndex(nbindex) 1547 1533 !- 1548 ! LOCAL1549 !-1550 1534 INTEGER :: req_sz,siz1 1551 1535 REAL :: scal 1552 1536 CHARACTER(LEN=7) :: topp 1553 LOGICAL :: check = .FALSE. 1554 !--------------------------------------------------------------------- 1537 LOGICAL :: l_dbg 1538 !--------------------------------------------------------------------- 1539 CALL ipsldbg (old_status=l_dbg) 1555 1540 !- 1556 1541 ! 0.0 What size should be the data in the file … … 1571 1556 !- 1572 1557 siz1 = SIZE(var) 1573 CALL rest_alloc (1,siz1, check,'restput_opp_r1d')1574 CALL rest_alloc (2,req_sz, check,'restput_opp_r1d')1558 CALL rest_alloc (1,siz1,l_dbg,'restput_opp_r1d') 1559 CALL rest_alloc (2,req_sz,l_dbg,'restput_opp_r1d') 1575 1560 !- 1576 1561 ! 2.0 We do the operation needed. … … 1623 1608 INTEGER :: nbindex,ijndex(nbindex) 1624 1609 !- 1625 ! LOCAL1626 !-1627 1610 INTEGER :: jj,req_sz,ist,siz1 1628 1611 REAL :: scal 1629 1612 CHARACTER(LEN=7) :: topp 1630 LOGICAL :: check = .FALSE. 1631 !--------------------------------------------------------------------- 1613 LOGICAL :: l_dbg 1614 !--------------------------------------------------------------------- 1615 CALL ipsldbg (old_status=l_dbg) 1632 1616 !- 1633 1617 ! 0.0 What size should be the data in the file … … 1653 1637 !- 1654 1638 siz1 = SIZE(var,1) 1655 CALL rest_alloc (1,siz1, check,'restput_opp_r2d')1656 CALL rest_alloc (2,req_sz*jjm, check,'restput_opp_r2d')1639 CALL rest_alloc (1,siz1,l_dbg,'restput_opp_r2d') 1640 CALL rest_alloc (2,req_sz*jjm,l_dbg,'restput_opp_r2d') 1657 1641 !- 1658 1642 ! 2.0 We do the operation needed. … … 1694 1678 REAL :: var(:) 1695 1679 !- 1696 ! LOCAL1697 !-1698 1680 INTEGER :: ji,jl,req_sz,var_sz,siz1 1699 1681 CHARACTER(LEN=70) :: str,str2 1700 LOGICAL :: check = .FALSE. 1701 !--------------------------------------------------------------------- 1682 LOGICAL :: l_dbg 1683 !--------------------------------------------------------------------- 1684 CALL ipsldbg (old_status=l_dbg) 1702 1685 !- 1703 1686 ! 1.0 Allocate the temporary buffer we need … … 1706 1689 siz1 = SIZE(var) 1707 1690 var_sz = siz1 1708 CALL rest_alloc (1,var_sz, check,'restput_r1d')1691 CALL rest_alloc (1,var_sz,l_dbg,'restput_r1d') 1709 1692 !- 1710 1693 ! 2.0 Here we could check if the sizes specified agree … … 1753 1736 REAL :: var(:,:) 1754 1737 !- 1755 ! LOCAL1756 !-1757 1738 INTEGER :: ji,jj,jl,req_sz,var_sz,siz1,siz2 1758 1739 CHARACTER(LEN=70) :: str,str2 1759 LOGICAL :: check = .FALSE. 1760 !--------------------------------------------------------------------- 1740 LOGICAL :: l_dbg 1741 !--------------------------------------------------------------------- 1742 CALL ipsldbg (old_status=l_dbg) 1761 1743 !- 1762 1744 ! 1.0 Allocate the temporary buffer we need … … 1766 1748 siz2 = SIZE(var,2) 1767 1749 var_sz = siz1*siz2 1768 CALL rest_alloc (1,var_sz, check,'restput_r2d')1750 CALL rest_alloc (1,var_sz,l_dbg,'restput_r2d') 1769 1751 !- 1770 1752 ! 2.0 Here we could check if the sizes specified agree … … 1814 1796 REAL :: var(:,:,:) 1815 1797 !- 1816 ! LOCAL1817 !-1818 1798 INTEGER :: ji,jj,jk,jl,req_sz,var_sz,siz1,siz2,siz3 1819 1799 CHARACTER(LEN=70) :: str,str2 1820 LOGICAL :: check = .FALSE. 1821 !--------------------------------------------------------------------- 1800 LOGICAL :: l_dbg 1801 !--------------------------------------------------------------------- 1802 CALL ipsldbg (old_status=l_dbg) 1822 1803 !- 1823 1804 ! 1.0 Allocate the temporary buffer we need … … 1828 1809 siz3 = SIZE(var,3) 1829 1810 var_sz = siz1*siz2*siz3 1830 CALL rest_alloc (1,var_sz, check,'restput_r3d')1811 CALL rest_alloc (1,var_sz,l_dbg,'restput_r3d') 1831 1812 !- 1832 1813 ! 2.0 Here we could check if the sizes specified agree … … 1899 1880 REAL :: var(:) 1900 1881 !- 1901 ! LOCAL1902 !-1903 1882 INTEGER :: iret,vid,ncid,iv,vnb 1904 1883 INTEGER :: ierr … … 1906 1885 INTEGER :: ndims 1907 1886 INTEGER,DIMENSION(4) :: corner,edge 1908 !- 1909 LOGICAL :: check = .FALSE. 1910 !--------------------------------------------------------------------- 1887 LOGICAL :: l_dbg 1888 !--------------------------------------------------------------------- 1889 CALL ipsldbg (old_status=l_dbg) 1911 1890 !- 1912 1891 ! 0.0 Get some variables … … 1921 1900 ! 1.0 Check if the variable is already present 1922 1901 !- 1923 IF ( check) WRITE(*,*) 'RESTPUT 1.0 : ',TRIM(vname_q)1902 IF (l_dbg) WRITE(*,*) 'RESTPUT 1.0 : ',TRIM(vname_q) 1924 1903 !- 1925 1904 CALL find_str (varname_out(fid,1:nbvar_out(fid)),vname_q,vnb) 1926 1905 !- 1927 IF ( check) THEN1906 IF (l_dbg) THEN 1928 1907 WRITE(*,*) 'RESTPUT 1.1 : ',varname_out(fid,1:nbvar_out(fid)),vnb 1929 1908 ENDIF … … 1938 1917 vid = varid_out(fid,vnb) 1939 1918 !- 1940 IF ( check) WRITE(*,*) 'RESTPUT 2.0 : ',vnb,vid1919 IF (l_dbg) WRITE(*,*) 'RESTPUT 2.0 : ',vnb,vid 1941 1920 !- 1942 1921 ! 2.1 Is this file already in write mode ? … … 1951 1930 ! If not then check that all variables of previous time is OK. 1952 1931 !- 1953 IF ( check) WRITE(*,*) 'RESTPUT 3.0 : ',itau,itau_out(fid)1932 IF (l_dbg) WRITE(*,*) 'RESTPUT 3.0 : ',itau,itau_out(fid) 1954 1933 !- 1955 1934 IF (itau /= itau_out(fid)) THEN … … 1989 1968 !-- 3.1 Here we add the values to the time axes 1990 1969 !--- 1991 IF ( check) THEN1970 IF (l_dbg) THEN 1992 1971 WRITE(*,*) 'RESTPUT 3.1 : ',itau,secsince,corner(1),edge(1) 1993 1972 ENDIF … … 2052 2031 LOGICAL :: write_att 2053 2032 !- 2054 ! Local2055 !-2056 2033 INTEGER :: dims(4),ic,xloc,ndim,ncfid 2057 2034 INTEGER :: iret,ax_id 2058 2035 CHARACTER(LEN=3) :: str 2059 !- 2060 LOGICAL :: check = .FALSE. 2061 !--------------------------------------------------------------------- 2036 LOGICAL :: l_dbg 2037 !--------------------------------------------------------------------- 2038 CALL ipsldbg (old_status=l_dbg) 2039 !- 2062 2040 ncfid = netcdf_id(fid,2) 2063 2041 IF (nbvar_out(fid) >= max_var) THEN … … 2077 2055 ! 1.0 Do we have all dimensions and can we go ahead 2078 2056 !- 2079 IF ( check) THEN2057 IF (l_dbg) THEN 2080 2058 WRITE(*,*) 'restdefv 1.0 :',TRIM(varname),nbvar_out(fid) 2081 2059 ENDIF … … 2153 2131 ! 2.0 Declare the variable 2154 2132 !- 2155 IF ( check) THEN2133 IF (l_dbg) THEN 2156 2134 WRITE(*,*) 'restdefv 2.0 :',ndim,' :: ',dims(1:ndim),tdimid_out(fid) 2157 2135 ENDIF … … 2188 2166 ENDIF 2189 2167 !- 2190 IF ( check) THEN2168 IF (l_dbg) THEN 2191 2169 WRITE(*,*) & 2192 2170 & 'restdefv 3.0 : LIST OF VARS ',varname_out(fid,1:nbvar_out(fid)) … … 2359 2337 !- 2360 2338 CHARACTER(LEN=*) :: attname,value 2361 !-2362 ! LOCAL2363 2339 !- 2364 2340 CHARACTER(LEN=LEN_TRIM(attname)) :: tmp_str … … 2393 2369 INTEGER,DIMENSION(varnbdim_max),INTENT(OUT) :: vardims 2394 2370 !- 2395 ! LOCAL2396 !-2397 2371 INTEGER :: vnb 2398 2372 !--------------------------------------------------------------------- … … 2493 2467 INTEGER,INTENT(in),OPTIONAL :: fid 2494 2468 !- 2495 !- LOCAL2496 !-2497 2469 INTEGER :: iret,ifnc 2498 2470 CHARACTER(LEN=6) :: n_e 2499 2471 CHARACTER(LEN=3) :: n_f 2500 LOGICAL :: check = .FALSE. 2501 !--------------------------------------------------------------------- 2472 LOGICAL :: l_dbg 2473 !--------------------------------------------------------------------- 2474 CALL ipsldbg (old_status=l_dbg) 2475 !- 2502 2476 IF (PRESENT(fid)) THEN 2503 2477 !--- 2504 IF ( check) THEN2478 IF (l_dbg) THEN 2505 2479 WRITE(*,*) & 2506 2480 'restclo : Closing specified restart file number :', & … … 2535 2509 ELSE 2536 2510 !--- 2537 IF ( check) WRITE(*,*) 'restclo : Closing all files'2511 IF (l_dbg) WRITE(*,*) 'restclo : Closing all files' 2538 2512 !--- 2539 2513 DO ifnc=1,nb_fi
Note: See TracChangeset
for help on using the changeset viewer.