Ignore:
Timestamp:
Oct 22, 2024, 11:35:08 AM (5 weeks ago)
Author:
abarral
Message:

Replace uses of cpp key NC_DOUBLE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/phyaqua_mod.F90

    r5084 r5249  
    593593    USE mod_phys_lmdz_transfert_para, ONLY: gather
    594594    USE phys_cal_mod, ONLY: year_len
     595    USE netcdf, ONLY: nf90_put_var, nf90_def_var
     596    USE lmdz_cppkeys_wrapper, ONLY: nf90_format
    595597    IMPLICIT NONE
    596598    include "netcdf.inc"
     
    636638      dims(2) = ntim
    637639
    638 #ifdef NC_DOUBLE
    639       ierr = nf_def_var(nid, 'TEMPS', nf_double, 1, ntim, id_tim)
    640 #else
    641       ierr = nf_def_var(nid, 'TEMPS', nf_float, 1, ntim, id_tim)
    642 #endif
     640      ierr = nf90_def_var(nid, 'TEMPS', nf90_format, ntim, id_tim)
    643641      ierr = nf_put_att_text(nid, id_tim, 'title', 17, 'Jour dans l annee')
    644642
    645 #ifdef NC_DOUBLE
    646       ierr = nf_def_var(nid, 'NAT', nf_double, 2, dims, id_nat)
    647 #else
    648       ierr = nf_def_var(nid, 'NAT', nf_float, 2, dims, id_nat)
    649 #endif
     643      ierr = nf90_def_var(nid, 'NAT', nf90_format, dims, id_nat)
    650644      ierr = nf_put_att_text(nid, id_nat, 'title', 23, &
    651645        'Nature du sol (0,1,2,3)')
    652646
    653 #ifdef NC_DOUBLE
    654       ierr = nf_def_var(nid, 'SST', nf_double, 2, dims, id_sst)
    655 #else
    656       ierr = nf_def_var(nid, 'SST', nf_float, 2, dims, id_sst)
    657 #endif
     647      ierr = nf90_def_var(nid, 'SST', nf90_format, dims, id_sst)
    658648      ierr = nf_put_att_text(nid, id_sst, 'title', 35, &
    659649        'Temperature superficielle de la mer')
    660650
    661 #ifdef NC_DOUBLE
    662       ierr = nf_def_var(nid, 'BILS', nf_double, 2, dims, id_bils)
    663 #else
    664       ierr = nf_def_var(nid, 'BILS', nf_float, 2, dims, id_bils)
    665 #endif
     651      ierr = nf90_def_var(nid, 'BILS', nf90_format, dims, id_bils)
    666652      ierr = nf_put_att_text(nid, id_bils, 'title', 32, &
    667653        'Reference flux de chaleur au sol')
    668654
    669 #ifdef NC_DOUBLE
    670       ierr = nf_def_var(nid, 'ALB', nf_double, 2, dims, id_alb)
    671 #else
    672       ierr = nf_def_var(nid, 'ALB', nf_float, 2, dims, id_alb)
    673 #endif
     655      ierr = nf90_def_var(nid, 'ALB', nf90_format, dims, id_alb)
    674656      ierr = nf_put_att_text(nid, id_alb, 'title', 19, 'Albedo a la surface')
    675657
    676 #ifdef NC_DOUBLE
    677       ierr = nf_def_var(nid, 'RUG', nf_double, 2, dims, id_rug)
    678 #else
    679       ierr = nf_def_var(nid, 'RUG', nf_float, 2, dims, id_rug)
    680 #endif
     658      ierr = nf90_def_var(nid, 'RUG', nf90_format, dims, id_rug)
    681659      ierr = nf_put_att_text(nid, id_rug, 'title', 8, 'Rugosite')
    682660
    683 #ifdef NC_DOUBLE
    684       ierr = nf_def_var(nid, 'FTER', nf_double, 2, dims, id_fter)
    685 #else
    686       ierr = nf_def_var(nid, 'FTER', nf_float, 2, dims, id_fter)
    687 #endif
     661      ierr = nf90_def_var(nid, 'FTER', nf90_format, dims, id_fter)
    688662      ierr = nf_put_att_text(nid, id_fter, 'title',10,'Frac. Land')
    689 #ifdef NC_DOUBLE
    690       ierr = nf_def_var(nid, 'FOCE', nf_double, 2, dims, id_foce)
    691 #else
    692       ierr = nf_def_var(nid, 'FOCE', nf_float, 2, dims, id_foce)
    693 #endif
     663      ierr = nf90_def_var(nid, 'FOCE', nf90_format, dims, id_foce)
    694664      ierr = nf_put_att_text(nid, id_foce, 'title',11,'Frac. Ocean')
    695 #ifdef NC_DOUBLE
    696       ierr = nf_def_var(nid, 'FSIC', nf_double, 2, dims, id_fsic)
    697 #else
    698       ierr = nf_def_var(nid, 'FSIC', nf_float, 2, dims, id_fsic)
    699 #endif
     665      ierr = nf90_def_var(nid, 'FSIC', nf90_format, dims, id_fsic)
    700666      ierr = nf_put_att_text(nid, id_fsic, 'title',13,'Frac. Sea Ice')
    701 #ifdef NC_DOUBLE
    702       ierr = nf_def_var(nid, 'FLIC', nf_double, 2, dims, id_flic)
    703 #else
    704       ierr = nf_def_var(nid, 'FLIC', nf_float, 2, dims, id_flic)
    705 #endif
     667      ierr = nf90_def_var(nid, 'FLIC', nf90_format, dims, id_flic)
    706668      ierr = nf_put_att_text(nid, id_flic, 'title',14,'Frac. Land Ice')
    707669
     
    715677      ! write the 'times'
    716678      DO k = 1, year_len
    717 #ifdef NC_DOUBLE
    718         ierr = nf_put_var1_double(nid, id_tim, k, dble(k))
    719 #else
    720         ierr = nf_put_var1_real(nid, id_tim, k, float(k))
    721 #endif
     679        ierr = nf90_put_var(nid, id_tim, k, [k])
    722680        IF (ierr/=nf_noerr) THEN
    723681          WRITE (*, *) 'writelim error with temps(k),k=', k
     
    732690    CALL gather(phy_nat, phy_glo)
    733691    IF (is_master) THEN
    734 #ifdef NC_DOUBLE
    735       ierr = nf_put_var_double(nid, id_nat, phy_glo)
    736 #else
    737       ierr = nf_put_var_real(nid, id_nat, phy_glo)
    738 #endif
     692      ierr = nf90_put_var(nid, id_nat, phy_glo)
    739693      IF (ierr/=nf_noerr) THEN
    740694        WRITE (*, *) 'writelim error with phy_nat'
     
    745699    CALL gather(phy_sst, phy_glo)
    746700    IF (is_master) THEN
    747 #ifdef NC_DOUBLE
    748       ierr = nf_put_var_double(nid, id_sst, phy_glo)
    749 #else
    750       ierr = nf_put_var_real(nid, id_sst, phy_glo)
    751 #endif
     701      ierr = nf90_put_var(nid, id_sst, phy_glo)
    752702      IF (ierr/=nf_noerr) THEN
    753703        WRITE (*, *) 'writelim error with phy_sst'
     
    758708    CALL gather(phy_bil, phy_glo)
    759709    IF (is_master) THEN
    760 #ifdef NC_DOUBLE
    761       ierr = nf_put_var_double(nid, id_bils, phy_glo)
    762 #else
    763       ierr = nf_put_var_real(nid, id_bils, phy_glo)
    764 #endif
     710      ierr = nf90_put_var(nid, id_bils, phy_glo)
    765711      IF (ierr/=nf_noerr) THEN
    766712        WRITE (*, *) 'writelim error with phy_bil'
     
    771717    CALL gather(phy_alb, phy_glo)
    772718    IF (is_master) THEN
    773 #ifdef NC_DOUBLE
    774       ierr = nf_put_var_double(nid, id_alb, phy_glo)
    775 #else
    776       ierr = nf_put_var_real(nid, id_alb, phy_glo)
    777 #endif
     719      ierr = nf90_put_var(nid, id_alb, phy_glo)
    778720      IF (ierr/=nf_noerr) THEN
    779721        WRITE (*, *) 'writelim error with phy_alb'
     
    784726    CALL gather(phy_rug, phy_glo)
    785727    IF (is_master) THEN
    786 #ifdef NC_DOUBLE
    787       ierr = nf_put_var_double(nid, id_rug, phy_glo)
    788 #else
    789       ierr = nf_put_var_real(nid, id_rug, phy_glo)
    790 #endif
     728      ierr = nf90_put_var(nid, id_rug, phy_glo)
    791729      IF (ierr/=nf_noerr) THEN
    792730        WRITE (*, *) 'writelim error with phy_rug'
     
    797735    CALL gather(phy_fter, phy_glo)
    798736    IF (is_master) THEN
    799 #ifdef NC_DOUBLE
    800       ierr = nf_put_var_double(nid, id_fter, phy_glo)
    801 #else
    802       ierr = nf_put_var_real(nid, id_fter, phy_glo)
    803 #endif
     737      ierr = nf90_put_var(nid, id_fter, phy_glo)
    804738      IF (ierr/=nf_noerr) THEN
    805739        WRITE (*, *) 'writelim error with phy_fter'
     
    810744    CALL gather(phy_foce, phy_glo)
    811745    IF (is_master) THEN
    812 #ifdef NC_DOUBLE
    813       ierr = nf_put_var_double(nid, id_foce, phy_glo)
    814 #else
    815       ierr = nf_put_var_real(nid, id_foce, phy_glo)
    816 #endif
     746      ierr = nf90_put_var(nid, id_foce, phy_glo)
    817747      IF (ierr/=nf_noerr) THEN
    818748        WRITE (*, *) 'writelim error with phy_foce'
     
    823753    CALL gather(phy_fsic, phy_glo)
    824754    IF (is_master) THEN
    825 #ifdef NC_DOUBLE
    826       ierr = nf_put_var_double(nid, id_fsic, phy_glo)
    827 #else
    828       ierr = nf_put_var_real(nid, id_fsic, phy_glo)
    829 #endif
     755      ierr = nf90_put_var(nid, id_fsic, phy_glo)
    830756      IF (ierr/=nf_noerr) THEN
    831757        WRITE (*, *) 'writelim error with phy_fsic'
     
    836762    CALL gather(phy_flic, phy_glo)
    837763    IF (is_master) THEN
    838 #ifdef NC_DOUBLE
    839       ierr = nf_put_var_double(nid, id_flic, phy_glo)
    840 #else
    841       ierr = nf_put_var_real(nid, id_flic, phy_glo)
    842 #endif
     764      ierr = nf90_put_var(nid, id_flic, phy_glo)
    843765      IF (ierr/=nf_noerr) THEN
    844766        WRITE (*, *) 'writelim error with phy_flic'
Note: See TracChangeset for help on using the changeset viewer.