- Timestamp:
- 2019-07-24T11:20:42+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11265_ASINTER-01_Guillaume_ABL1D/src/OCE/DIA/diawri.F90
r10425 r11334 26 26 !!---------------------------------------------------------------------- 27 27 USE oce ! ocean dynamics and tracers 28 USE abl ! abl variables in case ln_abl = .true. 28 29 USE dom_oce ! ocean space and time domain 29 30 USE phycst ! physical constants … … 66 67 PUBLIC dia_wri_state 67 68 PUBLIC dia_wri_alloc ! Called by nemogcm module 68 69 #if ! defined key_iomput 70 PUBLIC dia_wri_alloc_abl ! Called by sbcabl module (if ln_abl = .true.) 71 #endif 69 72 INTEGER :: nid_T, nz_T, nh_T, ndim_T, ndim_hT ! grid_T file 70 INTEGER :: nb_T , ndim_bT! grid_T file73 INTEGER :: nb_T, ndim_bT ! grid_T file 71 74 INTEGER :: nid_U, nz_U, nh_U, ndim_U, ndim_hU ! grid_U file 72 75 INTEGER :: nid_V, nz_V, nh_V, ndim_V, ndim_hV ! grid_V file 73 76 INTEGER :: nid_W, nz_W, nh_W ! grid_W file 77 INTEGER :: ndim_A, ndim_hA ! grid_T file 78 INTEGER :: nid_A, nz_A, nh_A ! grid_ABL file 74 79 INTEGER :: ndex(1) ! ??? 75 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV 76 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_T, ndex_U, ndex_V 80 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_hT, ndex_hU, ndex_hV, ndex_hA 81 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_T, ndex_U, ndex_V, ndex_A 77 82 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: ndex_bT 78 83 … … 409 414 & ndex_hU(jpi*jpj) , ndex_U(jpi*jpj*jpk) , & 410 415 & ndex_hV(jpi*jpj) , ndex_V(jpi*jpj*jpk) , STAT=ierr(1) ) 411 ! 412 dia_wri_alloc = MAXVAL(ierr) 416 dia_wri_alloc = MAXVAL(ierr) 413 417 CALL mpp_sum( 'diawri', dia_wri_alloc ) 414 418 ! 415 419 END FUNCTION dia_wri_alloc 416 417 420 421 INTEGER FUNCTION dia_wri_alloc_abl() 422 !!---------------------------------------------------------------------- 423 ALLOCATE( ndex_hA(jpi*jpj), ndex_A (jpi*jpj*jpkam1), STAT=dia_wri_alloc_abl) 424 CALL mpp_sum( 'diawri', dia_wri_alloc_abl ) 425 ! 426 END FUNCTION dia_wri_alloc_abl 427 418 428 SUBROUTINE dia_wri( kt ) 419 429 !!--------------------------------------------------------------------- … … 435 445 INTEGER :: ji, jj, jk ! dummy loop indices 436 446 INTEGER :: ierr ! error code return from allocation 437 INTEGER :: iimi, iima, ipk, it, itmod, ijmi, ijma ! local integers447 INTEGER :: iimi, iima, ipk, it, itmod, ijmi, ijma, ipka ! local integers 438 448 INTEGER :: jn, ierror ! local integers 439 449 REAL(wp) :: zsto, zout, zmax, zjulian ! local scalars … … 441 451 REAL(wp), DIMENSION(jpi,jpj) :: zw2d ! 2D workspace 442 452 REAL(wp), DIMENSION(jpi,jpj,jpk) :: zw3d ! 3D workspace 453 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zw3d_abl ! 3D workspace 443 454 !!---------------------------------------------------------------------- 444 455 ! … … 449 460 ninist = 0 450 461 ENDIF 462 451 463 ! 452 464 ! 0. Initialisation … … 472 484 ijmi = 1 ; ijma = jpj 473 485 ipk = jpk 486 IF(ln_abl) ipka = jpkam1 474 487 475 488 ! define time axis … … 574 587 & "m", ipk, gdepw_1d, nz_W, "down" ) 575 588 589 IF( ln_abl ) THEN 590 ! Define the ABL grid FILE ( nid_A ) 591 CALL dia_nam( clhstnam, nwrite, 'grid_ABL' ) 592 IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam ! filename 593 CALL histbeg( clhstnam, jpi, glamt, jpj, gphit, & ! Horizontal grid: glamt and gphit 594 & iimi, iima-iimi+1, ijmi, ijma-ijmi+1, & 595 & nit000-1, zjulian, rdt, nh_A, nid_A, domain_id=nidom, snc4chunks=snc4set ) 596 CALL histvert( nid_A, "ght_abl", "Vertical T levels", & ! Vertical grid: gdept 597 & "m", ipka, ght_abl(2:jpka), nz_A, "up" ) 598 ! ! Index of ocean points 599 ALLOCATE( zw3d_abl(jpi,jpj,ipka) ) 600 zw3d_abl(:,:,:) = 1._wp 601 CALL wheneq( jpi*jpj*ipka, zw3d_abl, 1, 1., ndex_A , ndim_A ) ! volume 602 CALL wheneq( jpi*jpj , zw3d_abl, 1, 1., ndex_hA, ndim_hA ) ! surface 603 DEALLOCATE(zw3d_abl) 604 ENDIF 576 605 577 606 ! Declare all the output fields as NETCDF variables … … 623 652 CALL histdef( nid_T, "sowindsp", "wind speed at 10m" , "m/s" , & ! wndm 624 653 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 654 ! 655 IF( ln_abl ) THEN 656 ! !!! nid_A : 3D 657 CALL histdef( nid_A, "t_abl", "Potential Temperature" , "K" , & ! t_abl 658 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 659 CALL histdef( nid_A, "q_abl", "Humidity" , "kg/kg" , & ! q_abl 660 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 661 CALL histdef( nid_A, "u_abl", "Atmospheric U-wind " , "m/s" , & ! u_abl 662 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 663 CALL histdef( nid_A, "v_abl", "Atmospheric V-wind " , "m/s" , & ! v_abl 664 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 665 CALL histdef( nid_A, "tke_abl", "Atmospheric TKE " , "m2/s2" , & ! tke_abl 666 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 667 CALL histdef( nid_A, "avm_abl", "Atmospheric turbulent viscosity", "m2/s" , & ! avm_abl 668 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 669 CALL histdef( nid_A, "avt_abl", "Atmospheric turbulent diffusivity", "m2/s2", & ! avt_abl 670 & jpi, jpj, nh_A, ipka, 1, ipka, nz_A, 32, clop, zsto, zout ) 671 CALL histdef( nid_A, "pblh", "Atmospheric boundary layer height " , "m", & ! pblh 672 & jpi, jpj, nh_A, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 673 #if defined key_si3 674 CALL histdef( nid_A, "oce_frac", "Fraction of open ocean" , " ", & ! ato_i 675 & jpi, jpj, nh_A, 1 , 1, 1 , -99 , 32, clop, zsto, zout ) 676 #endif 677 CALL histend( nid_A, snc4chunks=snc4set ) 678 ! 679 ENDIF 625 680 ! 626 681 IF( ln_icebergs ) THEN … … 676 731 677 732 clmx ="l_max(only(x))" ! max index on a period 678 !CALL histdef( nid_T, "sobowlin", "Bowl Index" , "W-point", & ! bowl INDEX679 !& jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clmx, zsto, zout )733 CALL histdef( nid_T, "sobowlin", "Bowl Index" , "W-point", & ! bowl INDEX 734 & jpi, jpj, nh_T, 1 , 1, 1 , -99 , 32, clmx, zsto, zout ) 680 735 #if defined key_diahth 681 736 CALL histdef( nid_T, "sothedep", "Thermocline Depth" , "m" , & ! hth … … 790 845 CALL histwrite( nid_T, "soicecov", it, fr_i , ndim_hT, ndex_hT ) ! ice fraction 791 846 CALL histwrite( nid_T, "sowindsp", it, wndm , ndim_hT, ndex_hT ) ! wind speed 847 ! 848 IF( ln_abl ) THEN 849 ALLOCATE( zw3d_abl(jpi,jpj,jpka) ) 850 IF( ln_mskland ) THEN 851 DO jk=1,jpka 852 zw3d_abl(:,:,jk) = tmask(:,:,1) 853 END DO 854 ELSE 855 zw3d_abl(:,:,:) = 1._wp 856 ENDIF 857 CALL histwrite( nid_A, "pblh" , it, pblh(:,:) *zw3d_abl(:,:,1 ), ndim_hA, ndex_hA ) ! pblh 858 CALL histwrite( nid_A, "u_abl" , it, u_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! u_abl 859 CALL histwrite( nid_A, "v_abl" , it, v_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! v_abl 860 CALL histwrite( nid_A, "t_abl" , it, tq_abl (:,:,2:jpka,nt_n,1)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! t_abl 861 CALL histwrite( nid_A, "q_abl" , it, tq_abl (:,:,2:jpka,nt_n,2)*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! q_abl 862 CALL histwrite( nid_A, "tke_abl", it, tke_abl (:,:,2:jpka,nt_n )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! tke_abl 863 CALL histwrite( nid_A, "avm_abl", it, avm_abl (:,:,2:jpka )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! avm_abl 864 CALL histwrite( nid_A, "avt_abl", it, avt_abl (:,:,2:jpka )*zw3d_abl(:,:,2:jpka), ndim_A , ndex_A ) ! avt_abl 865 #if defined key_si3 866 CALL histwrite( nid_A, "oce_frac" , it, ato_i(:,:) , ndim_hA, ndex_hA ) ! ato_i 867 #endif 868 DEALLOCATE(zw3d_abl) 869 ENDIF 792 870 ! 793 871 IF( ln_icebergs ) THEN … … 826 904 CALL histwrite( nid_T, "sosafldp", it, zw2d , ndim_hT, ndex_hT ) ! salt flux damping 827 905 ENDIF 828 !zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1)829 !CALL histwrite( nid_T, "sobowlin", it, zw2d , ndim_hT, ndex_hT ) ! ???906 zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1) 907 CALL histwrite( nid_T, "sobowlin", it, zw2d , ndim_hT, ndex_hT ) ! ??? 830 908 831 909 #if defined key_diahth … … 862 940 CALL histclo( nid_V ) 863 941 CALL histclo( nid_W ) 942 IF(ln_abl) CALL histclo( nid_A ) 864 943 ENDIF 865 944 !
Note: See TracChangeset
for help on using the changeset viewer.