Changeset 2001 for LMDZ5/trunk/libf/phylmd/iophy.F90
- Timestamp:
- Apr 3, 2014, 3:52:45 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/phylmd/iophy.F90
r1907 r2001 568 568 INCLUDE "temps.h" 569 569 INCLUDE "clesphys.h" 570 INCLUDE "iniprint.h" 570 571 571 572 INTEGER :: iff … … 602 603 603 604 #ifdef CPP_XIOS 605 IF ( var%flag(iff)<=lev_files(iff) ) THEN 604 606 CALL wxios_add_field_to_file(var%name, 2, iff, phys_out_filenames(iff), & 605 607 var%description, var%unit, var%flag(iff), typeecrit) 608 IF (prt_level >= 10) THEN 609 WRITE(lunout,*) 'histdef2d: call wxios_add_field_to_file var%name iff: ', & 610 trim(var%name),iff 611 ENDIF 612 ENDIF 606 613 #endif 607 614 #ifndef CPP_NO_IOIPSL … … 628 635 END IF 629 636 END SUBROUTINE histdef2d 637 630 638 SUBROUTINE histdef3d (iff,var) 631 639 … … 645 653 INCLUDE "temps.h" 646 654 INCLUDE "clesphys.h" 655 INCLUDE "iniprint.h" 647 656 648 657 INTEGER :: iff … … 679 688 680 689 #ifdef CPP_XIOS 690 IF ( var%flag(iff)<=lev_files(iff) ) THEN 681 691 CALL wxios_add_field_to_file(var%name, 3, iff, phys_out_filenames(iff), & 682 692 var%description, var%unit, var%flag(iff), typeecrit) 693 IF (prt_level >= 10) THEN 694 WRITE(lunout,*) 'histdef3d: call wxios_add_field_to_file var%name iff: ', & 695 trim(var%name),iff 696 ENDIF 697 ENDIF 683 698 #endif 684 699 #ifndef CPP_NO_IOIPSL … … 881 896 882 897 INTEGER :: iff, iff_beg, iff_end 883 898 LOGICAL, SAVE :: firstx 899 !$OMP THREADPRIVATE(firstx) 900 884 901 REAL,DIMENSION(klon_mpi) :: buffer_omp 885 902 INTEGER, allocatable, DIMENSION(:) :: index2d … … 889 906 REAL, ALLOCATABLE, DIMENSION(:) :: fieldok 890 907 891 IF (prt_level >= 10) WRITE(lunout,*)'Begin histwrite2d_phy ',trim(var%name) 892 908 IF (prt_level >= 10) THEN 909 WRITE(lunout,*)'Begin histwrite2d_phy for ',trim(var%name) 910 ENDIF 893 911 ! ug RUSTINE POUR LES STD LEVS..... 894 912 IF (PRESENT(STD_iff)) THEN … … 925 943 926 944 ! La boucle sur les fichiers: 945 firstx=.true. 927 946 DO iff=iff_beg, iff_end 928 947 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 929 948 949 #ifdef CPP_XIOS 950 IF (firstx) THEN 951 if (prt_level >= 10) then 952 write(lunout,*)'Dans iophy histwrite2D,iff,var%name ',& 953 iff,trim(var%name) 954 write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call wxios_write_2D" 955 endif 956 CALL wxios_write_2D(var%name, Field2d) 957 firstx=.false. 958 ENDIF 959 #endif 960 930 961 IF(.NOT.clef_stations(iff)) THEN 931 962 ALLOCATE(index2d(iim*jj_nb)) … … 934 965 CALL histwrite(nid_files(iff),var%name,itau_iophy,Field2d,iim*jj_nb,index2d) 935 966 #endif 936 #ifdef CPP_XIOS937 IF (iff == iff_beg) THEN938 if (prt_level >= 10) then939 write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call wxios_write_2D"940 endif941 CALL wxios_write_2D(var%name, Field2d)942 ENDIF943 #endif967 !#ifdef CPP_XIOS 968 ! IF (iff == iff_beg) THEN 969 ! if (prt_level >= 10) then 970 ! write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call wxios_write_2D" 971 ! endif 972 ! CALL wxios_write_2D(var%name, Field2d) 973 ! ENDIF 974 !#endif 944 975 ELSE 945 976 ALLOCATE(fieldok(npstn)) … … 1001 1032 1002 1033 INTEGER :: iff, iff_beg, iff_end 1003 1034 LOGICAL, SAVE :: firstx 1035 !$OMP THREADPRIVATE(firstx) 1004 1036 REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp 1005 1037 REAL :: Field3d(iim,jj_nb,SIZE(field,2)) 1006 INTEGER :: ip, n, nlev 1038 INTEGER :: ip, n, nlev, nlevx 1007 1039 INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d 1008 1040 REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok … … 1033 1065 IF (SIZE(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 1034 1066 nlev=SIZE(field,2) 1035 1067 if (nlev.eq.klev+1) then 1068 nlevx=klev 1069 else 1070 nlevx=nlev 1071 endif 1036 1072 1037 1073 CALL Gather_omp(field,buffer_omp) … … 1041 1077 1042 1078 ! BOUCLE SUR LES FICHIERS 1079 firstx=.true. 1043 1080 DO iff=iff_beg, iff_end 1044 1081 IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN 1082 #ifdef CPP_XIOS 1083 IF (firstx) THEN 1084 if (prt_level >= 10) then 1085 write(lunout,*)'Dans iophy, histwrite3D iff nlev klev firstx', & 1086 iff,nlev,klev, firstx 1087 write(lunout,*)'histwrite3d_phy: call wxios_write_3D for ', & 1088 trim(var%name), ' with iim jjm nlevx = ', & 1089 iim,jj_nb,nlevx 1090 endif 1091 CALL wxios_write_3D(var%name, Field3d(:,:,1:nlevx)) 1092 firstx=.false. 1093 ENDIF 1094 #endif 1045 1095 IF (.NOT.clef_stations(iff)) THEN 1046 1096 ALLOCATE(index3d(iim*jj_nb*nlev)) … … 1051 1101 #endif 1052 1102 1053 #ifdef CPP_XIOS1054 IF (iff == 1) THEN1055 CALL wxios_write_3D(var%name, Field3d(:,:,1:klev))1056 ENDIF1057 #endif1058 1103 !#ifdef CPP_XIOS 1104 ! IF (iff == 1) THEN 1105 ! CALL wxios_write_3D(var%name, Field3d(:,:,1:klev)) 1106 ! ENDIF 1107 !#endif 1108 ! 1059 1109 ELSE 1060 1110 nlev=size(field,2) … … 1204 1254 ALLOCATE(index3d(iim*jj_nb*nlev)) 1205 1255 ALLOCATE(fieldok(iim*jj_nb,nlev)) 1206 CALL wxios_write_3D(field_name, Field3d(:,:,1: klev))1256 CALL wxios_write_3D(field_name, Field3d(:,:,1:nlev)) 1207 1257 1208 1258 ELSE
Note: See TracChangeset
for help on using the changeset viewer.