@@ -7043,106 +7043,108 @@ subroutine ADD_INCS ( STATE,IMPORT,DT,IS_WEIGHTED,RC )
70437043 if (.not. ADIABATIC) then
70447044 _ASSERT(nwat >= 1 , ' expecting water species (nwat) to match' )
70457045 endif
7046+
7047+ select case (nwat)
7048+ case (1 )
7049+ sphum = 1
7050+ liq_wat = - 1
7051+ ice_wat = - 1
7052+ rainwat = - 1
7053+ snowwat = - 1
7054+ graupel = - 1
7055+ case (3 )
7056+ sphum = 1
7057+ liq_wat = 2
7058+ ice_wat = 3
7059+ rainwat = - 1
7060+ snowwat = - 1
7061+ graupel = - 1
7062+ case (6 :7 )
7063+ sphum = 1
7064+ liq_wat = 2
7065+ ice_wat = 3
7066+ rainwat = 4
7067+ snowwat = 5
7068+ graupel = 6
7069+ end select
7070+
70467071 if (nwat >= 1 ) then
70477072 ALLOCATE ( Q(is:ie,js:je,1 :km,nwat) )
70487073 ALLOCATE ( CVM(is:ie,js:je,1 :km) )
70497074 Q(:,:,:,:) = 0.0
70507075 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' Q' , RC= rc )
70517076 if (DYN_COLDSTART .and. overwrite_Q .and. (.not. ADIABATIC)) then
70527077 ! USE Q computed by FV3
7053- call getQ(Q(:,:,:,1 ), ' Q' )
7078+ call getQ(Q(:,:,:,sphum ), ' Q' )
70547079 overwrite_Q= .false.
70557080 call WRITE_PARALLEL(" Using QV from FV3 Initial Conditions" )
70567081 fac = 1.0
7057- call prt_maxmin(' AI Q' , Q(:,:,:,1 ), is, ie, js, je, 0 , km, fac)
7082+ call prt_maxmin(' AI Q' , Q(:,:,:,sphum ), is, ie, js, je, 0 , km, fac)
70587083 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7059- if (size (Q(:,:,:,1 ))==size (qqq% content_r4 )) qqq% content_r4 = Q(:,:,:,1 )
7084+ if (size (Q(:,:,:,sphum ))==size (qqq% content_r4 )) qqq% content_r4 = Q(:,:,:,sphum )
70607085 elseif (associated (qqq% content)) then
7061- if (size (Q(:,:,:,1 ))==size (qqq% content)) qqq% content = Q(:,:,:,1 )
7086+ if (size (Q(:,:,:,sphum ))==size (qqq% content)) qqq% content = Q(:,:,:,sphum )
70627087 endif
70637088 else
70647089 ! Grab QV from imports
70657090 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7066- if (size (Q(:,:,:,1 ))==size (qqq% content_r4 )) Q(:,:,:,1 ) = qqq% content_r4
7091+ if (size (Q(:,:,:,sphum ))==size (qqq% content_r4 )) Q(:,:,:,sphum ) = qqq% content_r4
70677092 elseif (associated (qqq% content)) then
7068- if (size (Q(:,:,:,1 ))==size (qqq% content)) Q(:,:,:,1 ) = qqq% content
7093+ if (size (Q(:,:,:,sphum ))==size (qqq% content)) Q(:,:,:,sphum ) = qqq% content
70697094 endif
70707095 endif
70717096 endif
70727097 if (nwat >= 3 ) then
70737098 ! Grab QLIQ from imports
70747099 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QLLS' , RC= rc )
70757100 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7076- if (size (Q(:,:,:,2 ))==size (qqq% content_r4 )) Q(:,:,:,2 ) = Q(:,:,:,2 ) + qqq% content_r4
7101+ if (size (Q(:,:,:,liq_wat ))==size (qqq% content_r4 )) Q(:,:,:,liq_wat ) = Q(:,:,:,liq_wat ) + qqq% content_r4
70777102 elseif (associated (qqq% content)) then
7078- if (size (Q(:,:,:,2 ))==size (qqq% content)) Q(:,:,:,2 ) = Q(:,:,:,2 ) + qqq% content
7103+ if (size (Q(:,:,:,liq_wat ))==size (qqq% content)) Q(:,:,:,liq_wat ) = Q(:,:,:,liq_wat ) + qqq% content
70797104 endif
70807105 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QLCN' , RC= rc )
70817106 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7082- if (size (Q(:,:,:,2 ))==size (qqq% content_r4 )) Q(:,:,:,2 ) = Q(:,:,:,2 ) + qqq% content_r4
7107+ if (size (Q(:,:,:,liq_wat ))==size (qqq% content_r4 )) Q(:,:,:,liq_wat ) = Q(:,:,:,liq_wat ) + qqq% content_r4
70837108 elseif (associated (qqq% content)) then
7084- if (size (Q(:,:,:,2 ))==size (qqq% content)) Q(:,:,:,2 ) = Q(:,:,:,2 ) + qqq% content
7109+ if (size (Q(:,:,:,liq_wat ))==size (qqq% content)) Q(:,:,:,liq_wat ) = Q(:,:,:,liq_wat ) + qqq% content
70857110 endif
70867111 ! Grab QICE from imports
70877112 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QILS' , RC= rc )
70887113 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7089- if (size (Q(:,:,:,3 ))==size (qqq% content_r4 )) Q(:,:,:,3 ) = Q(:,:,:,3 ) + qqq% content_r4
7114+ if (size (Q(:,:,:,ice_wat ))==size (qqq% content_r4 )) Q(:,:,:,ice_wat ) = Q(:,:,:,ice_wat ) + qqq% content_r4
70907115 elseif (associated (qqq% content)) then
7091- if (size (Q(:,:,:,3 ))==size (qqq% content)) Q(:,:,:,3 ) = Q(:,:,:,3 ) + qqq% content
7116+ if (size (Q(:,:,:,ice_wat ))==size (qqq% content)) Q(:,:,:,ice_wat ) = Q(:,:,:,ice_wat ) + qqq% content
70927117 endif
70937118 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QICN' , RC= rc )
70947119 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7095- if (size (Q(:,:,:,3 ))==size (qqq% content_r4 )) Q(:,:,:,3 ) = Q(:,:,:,3 ) + qqq% content_r4
7120+ if (size (Q(:,:,:,ice_wat ))==size (qqq% content_r4 )) Q(:,:,:,ice_wat ) = Q(:,:,:,ice_wat ) + qqq% content_r4
70967121 elseif (associated (qqq% content)) then
7097- if (size (Q(:,:,:,3 ))==size (qqq% content)) Q(:,:,:,3 ) = Q(:,:,:,3 ) + qqq% content
7122+ if (size (Q(:,:,:,ice_wat ))==size (qqq% content)) Q(:,:,:,ice_wat ) = Q(:,:,:,ice_wat ) + qqq% content
70987123 endif
70997124 endif
71007125 if (nwat >= 6 ) then
71017126 ! Grab RAIN from imports
71027127 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QRAIN' , RC= rc )
71037128 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7104- if (size (Q(:,:,:,4 ))==size (qqq% content_r4 )) Q(:,:,:,4 ) = qqq% content_r4
7129+ if (size (Q(:,:,:,rainwat ))==size (qqq% content_r4 )) Q(:,:,:,rainwat ) = qqq% content_r4
71057130 elseif (associated (qqq% content)) then
7106- if (size (Q(:,:,:,4 ))==size (qqq% content)) Q(:,:,:,4 ) = qqq% content
7131+ if (size (Q(:,:,:,rainwat ))==size (qqq% content)) Q(:,:,:,rainwat ) = qqq% content
71077132 endif
71087133 ! Grab SNOW from imports
71097134 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QSNOW' , RC= rc )
71107135 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7111- if (size (Q(:,:,:,5 ))==size (qqq% content_r4 )) Q(:,:,:,5 ) = qqq% content_r4
7136+ if (size (Q(:,:,:,snowwat ))==size (qqq% content_r4 )) Q(:,:,:,snowwat ) = qqq% content_r4
71127137 elseif (associated (qqq% content)) then
7113- if (size (Q(:,:,:,5 ))==size (qqq% content)) Q(:,:,:,5 ) = qqq% content
7138+ if (size (Q(:,:,:,snowwat ))==size (qqq% content)) Q(:,:,:,snowwat ) = qqq% content
71147139 endif
71157140 ! Grab GRAUPEL from imports
71167141 call PULL_Q ( STATE, IMPORT, qqq, NXQ, InFieldName= ' QGRAUPEL' , RC= rc )
71177142 if ( (qqq% is_r4 ) .and. (associated (qqq% content_r4 )) ) then
7118- if (size (Q(:,:,:,6 ))==size (qqq% content_r4 )) Q(:,:,:,6 ) = qqq% content_r4
7143+ if (size (Q(:,:,:,graupel ))==size (qqq% content_r4 )) Q(:,:,:,graupel ) = qqq% content_r4
71197144 elseif (associated (qqq% content)) then
7120- if (size (Q(:,:,:,6 ))==size (qqq% content)) Q(:,:,:,6 ) = qqq% content
7145+ if (size (Q(:,:,:,graupel ))==size (qqq% content)) Q(:,:,:,graupel ) = qqq% content
71217146 endif
71227147 endif
7123- select case (nwat)
7124- case (1 )
7125- sphum = 1
7126- liq_wat = - 1
7127- ice_wat = - 1
7128- rainwat = - 1
7129- snowwat = - 1
7130- graupel = - 1
7131- case (3 )
7132- sphum = 1
7133- liq_wat = 2
7134- ice_wat = 3
7135- rainwat = - 1
7136- snowwat = - 1
7137- graupel = - 1
7138- case (6 :7 )
7139- sphum = 1
7140- liq_wat = 2
7141- ice_wat = 3
7142- rainwat = 4
7143- snowwat = 5
7144- graupel = 6
7145- end select
71467148
71477149 if ( (.not. ADIABATIC) .and. (DO_ADD_INCS) ) then
71487150
0 commit comments