Changeset 5154 for LMDZ6/branches/Amaury_dev/libf/phylmd/cosp
- Timestamp:
- Jul 31, 2024, 9:54:47 PM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_output_write_mod.F90
r5133 r5154 3 3 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 4 4 MODULE cosp_output_write_mod 5 5 6 6 USE cosp_output_mod 7 7 8 8 IMPLICIT NONE 9 9 … … 28 28 USE wxios, only: wxios_closedef 29 29 USE lmdz_xios, only: xios_update_calendar, xios_field_is_active, using_xios 30 IMPLICIT NONE 30 IMPLICIT NONE 31 31 !!! Variables d'entree 32 32 integer :: itap, Nlevlmdz, Ncolumns, Npoints … … 67 67 itau_wcosp = itau_phy + itap + start_time * day_step_phy 68 68 if (prt_level >= 10) then 69 WRITE(lunout,*)'itau_wcosp, itap, start_time, day_step_phy =', & 69 WRITE(lunout,*)'itau_wcosp, itap, start_time, day_step_phy =', & 70 70 itau_wcosp, itap, start_time, day_step_phy 71 71 endif … … 78 78 79 79 ok_sync = .TRUE. 80 80 81 81 !DO iinit=1, iinitend 82 82 ! AI sept 2014 cette boucle supprimee … … 93 93 ! WRITE(lunout,*)'Apell xios_update_calendar cosp_varsdefined iinitend ', & 94 94 ! cosp_varsdefined,iinitend 95 ! endif 95 ! endif 96 96 ! CALL xios_update_calendar(itau_wcosp) 97 97 !ENDIF … … 102 102 !!!! Sorties Calipso 103 103 if (cfg%Llidar_sim) then 104 !!! AI 02 2018 104 !!! AI 02 2018 105 105 ! Traitement missing_val 106 106 where(stlidar%lidarcld == R_UNDEF) stlidar%lidarcld = missing_val 107 where(stlidar%proftemp == R_UNDEF) stlidar%proftemp = missing_val !TIBO 107 where(stlidar%proftemp == R_UNDEF) stlidar%proftemp = missing_val !TIBO 108 108 where(stlidar%profSR == R_UNDEF) stlidar%profSR = missing_val !TIBO2 109 where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val 110 where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val 109 where(sglidar%beta_mol == R_UNDEF) sglidar%beta_mol = missing_val 110 where(sglidar%beta_tot == R_UNDEF) sglidar%beta_tot = missing_val 111 111 where(stlidar%cldlayer == R_UNDEF) stlidar%cldlayer = missing_val 112 112 where(stlidar%cldtype == R_UNDEF) stlidar%cldtype = missing_val !OPAQ … … 119 119 where(stlidar%lidarcldtype == R_UNDEF) stlidar%lidarcldtype = missing_val !OPAQ 120 120 where(stlidar%lidarcldtmp == R_UNDEF) stlidar%lidarcldtmp = missing_val 121 121 122 122 ! print*,'Appel histwrite2d_cosp' 123 123 if (cfg%Lcllcalipso) CALL histwrite2d_cosp(o_cllcalipso,stlidar%cldlayer(:,1)) 124 124 if (cfg%Lclhcalipso) CALL histwrite2d_cosp(o_clhcalipso,stlidar%cldlayer(:,3)) 125 if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2)) 125 if (cfg%Lclmcalipso) CALL histwrite2d_cosp(o_clmcalipso,stlidar%cldlayer(:,2)) 126 126 if (cfg%Lcltcalipso) CALL histwrite2d_cosp(o_cltcalipso,stlidar%cldlayer(:,4)) 127 127 if (cfg%Lclcalipso) CALL histwrite3d_cosp(o_clcalipso,stlidar%lidarcld,nvert) … … 182 182 if (cfg%LparasolRefl) CALL histwrite3d_cosp(o_parasol_refl,stlidar%parasolrefl,nvertp) 183 183 184 if (cfg%LparasolRefl) then 184 if (cfg%LparasolRefl) then 185 185 do k=1,PARASOL_NREFL 186 186 do ip=1, Npoints … … 202 202 if (cfg%Latb532) CALL histwrite4d_cosp(o_atb532,sglidar%beta_tot) 203 203 ELSE 204 if (cfg%Latb532) then 205 do icl=1,Ncolumns 204 if (cfg%Latb532) then 205 do icl=1,Ncolumns 206 206 CALL histwrite3d_cosp(o_atb532,sglidar%beta_tot(:,icl,:),nvertmcosp,icl) 207 207 enddo 208 endif 208 endif 209 209 ENDIF 210 210 211 if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp) 211 if (cfg%LlidarBetaMol532) CALL histwrite3d_cosp(o_beta_mol532,sglidar%beta_mol,nvertmcosp) 212 212 213 213 endif !Lidar … … 259 259 where(isccp%fq_isccp == R_UNDEF) isccp%fq_isccp = missing_val 260 260 where(isccp%boxtau == R_UNDEF) isccp%boxtau = missing_val 261 where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val 261 where(isccp%boxptop == R_UNDEF) isccp%boxptop = missing_val 262 262 263 263 CALL histwrite2d_cosp(o_sunlit,gbx%sunlit) … … 267 267 if (cfg%Lclisccp) then 268 268 do icl=1,7 269 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl) 269 CALL histwrite3d_cosp(o_clisccp2,isccp%fq_isccp(:,icl,:),nvertisccp,icl) 270 270 enddo 271 271 endif … … 273 273 274 274 if (cfg%Lboxtauisccp) CALL histwrite3d_cosp(o_boxtauisccp,isccp%boxtau,nvertcol) 275 if (cfg%Lboxptopisccp) CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol) 276 if (cfg%Lcltisccp) CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea) 277 if (cfg%Lpctisccp) CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop) 278 if (cfg%Ltauisccp) CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld) 279 if (cfg%Lalbisccp) CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld) 280 if (cfg%Lmeantbisccp) CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb) 275 if (cfg%Lboxptopisccp) CALL histwrite3d_cosp(o_boxptopisccp,isccp%boxptop,nvertcol) 276 if (cfg%Lcltisccp) CALL histwrite2d_cosp(o_tclisccp,isccp%totalcldarea) 277 if (cfg%Lpctisccp) CALL histwrite2d_cosp(o_ctpisccp,isccp%meanptop) 278 if (cfg%Ltauisccp) CALL histwrite2d_cosp(o_tauisccp,isccp%meantaucld) 279 if (cfg%Lalbisccp) CALL histwrite2d_cosp(o_albisccp,isccp%meanalbedocld) 280 if (cfg%Lmeantbisccp) CALL histwrite2d_cosp(o_meantbisccp,isccp%meantb) 281 281 if (cfg%Lmeantbclrisccp) CALL histwrite2d_cosp(o_meantbclrisccp,isccp%meantbclr) 282 282 endif ! Isccp … … 294 294 ELSE 295 295 if (cfg%LclMISR) then 296 do icl=1,7 296 do icl=1,7 297 297 CALL histwrite3d_cosp(o_clMISR,misr%fq_MISR(:,icl,:),nvertmisr,icl) 298 298 enddo … … 329 329 modis%Cloud_Top_Pressure_Total_Mean = missing_val 330 330 where(modis%Liquid_Water_Path_Mean == R_UNDEF) & 331 modis%Liquid_Water_Path_Mean = missing_val 331 modis%Liquid_Water_Path_Mean = missing_val 332 332 where(modis%Ice_Water_Path_Mean == R_UNDEF) & 333 333 modis%Ice_Water_Path_Mean = missing_val … … 335 335 where(modis%Optical_Thickness_Total_LogMean == R_UNDEF) & 336 336 modis%Optical_Thickness_Total_LogMean = missing_val 337 337 338 338 where(modis%Optical_Thickness_Water_LogMean == R_UNDEF) & 339 339 modis%Optical_Thickness_Water_LogMean = missing_val … … 341 341 where(modis%Optical_Thickness_Ice_LogMean == R_UNDEF) & 342 342 modis%Optical_Thickness_Ice_LogMean = missing_val 343 343 344 344 if (cfg%Lcllmodis) CALL histwrite2d_cosp(o_cllmodis,modis%Cloud_Fraction_Low_Mean) 345 345 if (cfg%Lclhmodis) CALL histwrite2d_cosp(o_clhmodis,modis%Cloud_Fraction_High_Mean) … … 351 351 if (cfg%Ltauwmodis) CALL histwrite2d_cosp(o_tauwmodis,modis%Optical_Thickness_Water_Mean) 352 352 if (cfg%Ltauimodis) CALL histwrite2d_cosp(o_tauimodis,modis%Optical_Thickness_Ice_Mean) 353 if (cfg%Ltautlogmodis) CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean) 353 if (cfg%Ltautlogmodis) CALL histwrite2d_cosp(o_tautlogmodis,modis%Optical_Thickness_Total_LogMean) 354 354 if (cfg%Ltauwlogmodis) CALL histwrite2d_cosp(o_tauwlogmodis,modis%Optical_Thickness_Water_LogMean) 355 355 if (cfg%Ltauilogmodis) CALL histwrite2d_cosp(o_tauilogmodis,modis%Optical_Thickness_Ice_LogMean) … … 369 369 do icl=1,7 370 370 CALL histwrite3d_cosp(o_clmodis, & 371 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl) 371 modis%Optical_Thickness_vs_Cloud_Top_Pressure(:,icl,:),nvertisccp,icl) 372 372 enddo 373 endif 373 endif 374 374 ENDIF 375 375 … … 391 391 endif 392 392 if (cfg%Lcrlmodis) then 393 do icl=1,7 393 do icl=1,7 394 394 CALL histwrite3d_cosp(o_crlmodis, & 395 395 modis%Optical_Thickness_vs_ReffLiq(:,icl,:),nvertReffLiq,icl) 396 396 enddo 397 endif 397 endif 398 398 ENDIF 399 399 endif !modis … … 445 445 USE lmdz_print_control, ONLY: lunout,prt_level 446 446 USE wxios 447 USE lmdz_clesphys 447 448 448 449 IMPLICIT NONE 449 450 INCLUDE "clesphys.h"451 450 452 451 INTEGER :: iff … … 480 479 IF ( var%cles(iff) ) THEN 481 480 if (prt_level >= 10) then 482 WRITE(lunout,*)'Appel wxios_add_field_to_file var%name =',var%name 481 WRITE(lunout,*)'Appel wxios_add_field_to_file var%name =',var%name 483 482 endif 484 483 CALL wxios_add_field_to_file(var%name, 2, cosp_nidfiles(iff), cosp_outfilenames(iff), & … … 506 505 USE lmdz_print_control, ONLY: lunout,prt_level 507 506 USE wxios 507 USE lmdz_clesphys 508 508 509 509 IMPLICIT NONE 510 511 INCLUDE "clesphys.h"512 510 513 511 INTEGER :: iff, klevs … … 582 580 IF ( var%cles(iff) ) THEN 583 581 if (prt_level >= 10) then 584 WRITE(lunout,*)'Appel wxios_add_field_to_file 3d nom variable nam_axvert = ',nom, nam_axvert 582 WRITE(lunout,*)'Appel wxios_add_field_to_file 3d nom variable nam_axvert = ',nom, nam_axvert 585 583 endif 586 584 CALL wxios_add_field_to_file(nom, 3, cosp_nidfiles(iff), cosp_outfilenames(iff), & … … 610 608 USE lmdz_xios, only: xios_send_field, using_xios 611 609 USE lmdz_abort_physic, ONLY: abort_physic 610 USE lmdz_clesphys 612 611 613 612 IMPLICIT NONE 614 INCLUDE 'clesphys.h'615 613 616 614 TYPE(ctrl_outcosp), INTENT(IN) :: var … … 643 641 !Et sinon on.... écrit 644 642 IF (SIZE(field)/=klon) & 645 CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) 643 CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) 646 644 647 645 CALL Gather_omp(field,buffer_omp) … … 655 653 ALLOCATE(index2d(nbp_lon*jj_nb)) 656 654 #ifndef CPP_IOIPSL_NO_OUTPUT 657 CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d) 655 CALL histwrite(cosp_nidfiles(iff),var%name,itau_iocosp,Field2d,nbp_lon*jj_nb,index2d) 658 656 #endif 659 657 deallocate(index2d) … … 670 668 ENDIF 671 669 ENDIF 672 ENDDO 670 ENDDO 673 671 674 672 IF (using_xios) THEN … … 681 679 ENDIF 682 680 683 !$OMP END MASTER 681 !$OMP END MASTER 684 682 ENDIF ! vars_defined 685 683 IF (prt_level >= 9) WRITE(lunout,*)'End histrwrite2d_cosp ',var%name … … 697 695 USE lmdz_xios, only: xios_send_field, using_xios 698 696 USE lmdz_abort_physic, ONLY: abort_physic 697 USE lmdz_clesphys 699 698 700 699 IMPLICIT NONE 701 INCLUDE 'clesphys.h'702 700 703 701 TYPE(ctrl_outcosp), INTENT(IN) :: var … … 741 739 !Et sinon on.... écrit 742 740 IF (SIZE(field,1)/=klon) & 743 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 741 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 744 742 nlev=SIZE(field,2) 745 743 … … 755 753 ALLOCATE(index3d(nbp_lon*jj_nb*nlev)) 756 754 #ifndef CPP_IOIPSL_NO_OUTPUT 757 CALL histwrite(cosp_nidfiles(iff),nom,itau_iocosp,Field3d,nbp_lon*jj_nb*nlev,index3d) 755 CALL histwrite(cosp_nidfiles(iff),nom,itau_iocosp,Field3d,nbp_lon*jj_nb*nlev,index3d) 758 756 #endif 759 757 … … 778 776 ENDIF 779 777 780 !$OMP END MASTER 778 !$OMP END MASTER 781 779 ENDIF ! vars_defined 782 780 IF (prt_level >= 9) write(lunout,*)'End histrwrite3d_cosp ',nom … … 794 792 USE lmdz_xios, only: xios_send_field, using_xios 795 793 USE lmdz_abort_physic, ONLY: abort_physic 794 USE lmdz_clesphys 796 795 797 796 IMPLICIT NONE 798 INCLUDE 'clesphys.h'799 797 800 798 TYPE(ctrl_outcosp), INTENT(IN) :: var … … 814 812 !Et sinon on.... écrit 815 813 IF (SIZE(field,1)/=klon) & 816 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 814 CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1) 817 815 818 816 nlev=SIZE(field,2) … … 829 827 ENDIF 830 828 831 !$OMP END MASTER 829 !$OMP END MASTER 832 830 ENDIF ! vars_defined 833 831 IF (prt_level >= 9) write(lunout,*)'End histrwrite4d_cosp ',nom
Note: See TracChangeset
for help on using the changeset viewer.