Changeset 3991 for trunk/LMDZ.COMMON/libf/evolution/outputs.F90
- Timestamp:
- Dec 16, 2025, 4:39:24 PM (5 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/outputs.F90 (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/outputs.F90
r3989 r3991 1 1 MODULE outputs 2 2 !----------------------------------------------------------------------- 3 ! NAME 4 ! outputs 5 ! 6 ! DESCRIPTION 7 ! Tools to write PEM diagnostic outputs. 8 ! 9 ! AUTHORS & DATE 10 ! LMDZ team 11 ! E. Leconte, 2010 12 ! F. Forget, 2011 13 ! JB Clement, 2023–2025 14 ! 15 ! NOTES 16 ! Uses NetCDF low-level API and supports parallel runs. 17 !----------------------------------------------------------------------- 18 19 ! DECLARATION 20 ! ----------- 3 21 implicit none 4 22 23 ! MODULE VARIABLES 24 ! ---------------- 5 25 integer :: output_rate ! Output rate 6 26 7 !=======================================================================8 27 contains 9 ! =======================================================================28 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10 29 11 30 SUBROUTINE write_diagpem(ngrid,nom,titre,unite,dim,px) … … 48 67 ! dim : dimension de px : 0, 1, 2, ou 3 dimensions 49 68 ! 50 !================================================================= 69 !----------------------------------------------------------------------- 70 ! NAME 71 ! write_diagpem 72 ! 73 ! DESCRIPTION 74 ! Write selected diagnostic variables to NetCDF file 'diagpem.nc'. 75 ! Supports 3D, 2D, 1D (column), and 0D (scalar) variables. 76 ! 77 ! AUTHORS & DATE 78 ! E. Leconte, 2010 79 ! F. Forget, 2011 80 ! JB Clement, 2023–2025 81 ! 82 ! NOTES 83 ! Output cadence is controlled by 'output_rate' from run.def. Parallel-safe 84 ! with master task handling NetCDF I/O. Can use 'diagpem.def' to select vars. 85 !----------------------------------------------------------------------- 86 87 ! DEPENDENCIES 88 ! ------------ 51 89 use surfdat_h, only: phisfi 52 90 use geometry_mod, only: cell_area … … 54 92 use mod_grid_phy_lmdz, only: klon_glo, Grid1Dto2D_glo, nbp_lon, nbp_lat, nbp_lev, grid_type, unstructured 55 93 94 ! DECLARATION 95 ! ----------- 56 96 implicit none 57 97 … … 59 99 include "netcdf.inc" 60 100 61 ! Arguments on input: 101 ! ARGUMENTS 102 ! --------- 62 103 integer, intent(in) :: ngrid 63 104 character(len=*), intent(in) :: nom, titre, unite … … 65 106 real, dimension(ngrid,nbp_lev), intent(in) :: px 66 107 67 ! Local variables: 108 ! LOCAL VARIABLES 109 ! --------------- 68 110 real*4, dimension(nbp_lon + 1,nbp_lat,nbp_lev) :: dx3 ! to store a 3D data set 69 111 real*4, dimension(nbp_lon + 1,nbp_lat) :: dx2 ! to store a 2D (surface) data set … … 117 159 #endif 118 160 161 ! CODE 162 ! ---- 119 163 if (grid_type == unstructured) return 120 164 … … 580 624 581 625 END SUBROUTINE write_diagpem 582 583 626 !================================================================= 584 627 628 !================================================================= 585 629 SUBROUTINE write_diagsoilpem(ngrid,name,title,units,dimpx,px) 630 !----------------------------------------------------------------------- 631 ! NAME 632 ! write_diagsoilpem 633 ! 634 ! DESCRIPTION 635 ! Write soil-related diagnostic variables to 'diagsoilpem.nc'. 636 ! Supports 3D (lon,lat,depth), 2D (lon,lat), and 0D scalars. 637 ! 638 ! AUTHORS & DATE 639 ! E. Leconte, 2010 640 ! JB Clement, 2023–2025 641 ! 642 ! NOTES 643 ! Output cadence uses 'output_rate'. Only lon-lat (or 1D) grids supported. 644 !----------------------------------------------------------------------- 586 645 587 646 ! Write variable 'name' to NetCDF file 'diagsoilpem.nc'. … … 596 655 ! Modifs: Aug.2010 Ehouarn: enforce outputs to be real*4 597 656 657 ! DEPENDENCIES 658 ! ------------ 598 659 use soil, only: mlayer_PEM, nsoilmx_PEM, inertiedat_PEM 599 660 use geometry_mod, only: cell_area … … 603 664 use iniwritesoil_mod, only: iniwritesoil 604 665 666 ! DECLARATION 667 ! ----------- 605 668 implicit none 606 669 607 670 include"netcdf.inc" 608 671 609 ! Arguments: 610 integer,intent(in) :: ngrid ! number of (horizontal) points of physics grid 672 ! ARGUMENTS 673 ! --------- 674 integer, intent(in) :: ngrid ! number of (horizontal) points of physics grid 611 675 ! i.e. ngrid = 2+(jjm-1)*iim - 1/jjm 612 character(len=*),intent(in) :: name ! 'name' of the variable 613 character(len=*),intent(in) :: title ! 'long_name' attribute of the variable 614 character(len=*),intent(in) :: units ! 'units' attribute of the variable 615 integer,intent(in) :: dimpx ! dimension of the variable (3,2 or 0) 616 real,dimension(ngrid,nsoilmx_PEM),intent(in) :: px ! variable 617 618 ! Local variables: 676 character(len=*), intent(in) :: name ! 'name' of the variable 677 character(len=*), intent(in) :: title ! 'long_name' attribute of the variable 678 character(len=*), intent(in) :: units ! 'units' attribute of the variable 679 integer, intent(in) :: dimpx ! dimension of the variable (3,2 or 0) 680 real, dimension(ngrid,nsoilmx_PEM), intent(in) :: px ! variable 681 682 ! LOCAL VARIABLES 683 ! --------------- 619 684 real*4,dimension(nbp_lon+1,nbp_lat,nsoilmx_PEM) :: data3 ! to store 3D data 620 685 real*4,dimension(nbp_lon+1,nbp_lat) :: data2 ! to store 2D data … … 657 722 #endif 658 723 724 ! CODE 725 ! ---- 659 726 ! 0. Do we ouput a diagsoilpem.nc file? If not just bail out now. 660 727 … … 989 1056 990 1057 END SUBROUTINE write_diagsoilpem 1058 !================================================================= 991 1059 992 1060 END MODULE outputs
Note: See TracChangeset
for help on using the changeset viewer.
