Changeset 2913 for trunk/LMDZ.MARS/libf/phymars/iostart.F90
- Timestamp:
- Mar 14, 2023, 10:07:33 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/iostart.F90
r2907 r2913 15 15 INTEGER,SAVE :: idim7 ! "Time" dimension 16 16 INTEGER,SAVE :: idim8 ! "nslope" dimension 17 INTEGER,SAVE :: idim9 ! " inter slope" dimension17 INTEGER,SAVE :: idim9 ! "nslope_plus_1" dimension 18 18 INTEGER,SAVE :: timeindex ! current time index (for time-dependent fields) 19 19 INTEGER,PARAMETER :: length=100 ! size of tab_cntrl array … … 564 564 ENDIF 565 565 566 ierr=NF90_DEF_DIM(nid_restart,"inter 566 ierr=NF90_DEF_DIM(nid_restart,"inter_slope",nslope+1,idim9) 567 567 IF (ierr/=NF90_NOERR) THEN 568 568 write(*,*)'phyredem: problem defining inter slope dimension' … … 660 660 661 661 REAL :: field_glo(klon_glo,field_size) 662 REAL :: field_glo_reshape(klon_glo,nsoilmx,nslope,timeindex) 662 663 INTEGER :: ierr 663 664 INTEGER :: nvarid … … 804 805 endif ! of if (.not.present(timeindex)) 805 806 806 ELSE IF (field_size==nsoilmx ) THEN807 ELSE IF (field_size==nsoilmx .or. field_size==nsoilmx*nslope) THEN 807 808 ! input is a 2D "subsurface field" array 808 809 if (.not.present(time)) then ! for a time-independent field … … 828 829 ierr=NF90_REDEF(nid_restart) 829 830 #ifdef NC_DOUBLE 831 if(field_name.eq. "tsoil") then 832 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_DOUBLE,& 833 (/idim2,idim3,idim8,idim7/),nvarid) 834 else 830 835 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_DOUBLE,& 831 836 (/idim2,idim3,idim7/),nvarid) 832 #else 837 endif 838 #else 839 if(field_name.eq. "tsoil") then 840 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_FLOAT,& 841 (/idim2,idim3,idim8,idim7/),nvarid) 842 else 833 843 ierr=NF90_DEF_VAR(nid_restart,field_name,NF90_FLOAT,& 834 844 (/idim2,idim3,idim7/),nvarid) 845 endif 835 846 #endif 836 847 if (ierr.ne.NF90_NOERR) then … … 842 853 endif 843 854 ! Write the variable 855 if(field_name.eq. "tsoil") then 856 857 field_glo_reshape=RESHAPE(field_glo, (/klon_glo, nsoilmx, nslope, timeindex/)) 858 859 ierr=NF90_PUT_VAR(nid_restart,nvarid,field_glo_reshape,& 860 start=(/1,1,1,timeindex/)) 861 else 844 862 ierr=NF90_PUT_VAR(nid_restart,nvarid,field_glo,& 845 863 start=(/1,1,timeindex/)) 846 864 endif 847 865 endif ! of if (.not.present(time)) 848 866
Note: See TracChangeset
for help on using the changeset viewer.