anchor.diff:  		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
   		varid(16)=temp_id
   		
  -		call check( nf90_def_var(ncid, "crain", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","convective_rainfall_amount"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Convective rain (accumulated)"))
  -		call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  -		varid(17)=temp_id
  -		
  -		! surface fluxes
  -		call check( nf90_def_var(ncid, "rsds", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_shortwave_flux_in_air"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Shortwave downward radiation energy flux at the surface"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","down"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(18)=temp_id
  -
  -		call check( nf90_def_var(ncid, "rlds", NF90_REAL, dimids(1:3:2), temp_id) )
  -		call check( nf90_put_att(ncid,temp_id,"standard_name","surface_downwelling_longwave_flux_in_air"))
  -		call check( nf90_put_att(ncid,temp_id,"long_name","Longwave downward radiation energy flux at the surface"))
  -		call check( nf90_put_att(ncid,temp_id,"positive","down"))
  -		call check( nf90_put_att(ncid,temp_id,"units","W m-2"))
  -		varid(19)=temp_id
  +		if (options%physics%convection>0) then
  +			call check( nf90_def_var(ncid, "crain", NF90_REAL, dimids(1:3:2), temp_id) )
  +			call check( nf90_put_att(ncid,temp_id,"standard_name","convective_rainfall_amount"))
  +			call check( nf90_put_att(ncid,temp_id,"long_name","Convective rain (accumulated)"))
  +			call check( nf90_put_att(ncid,temp_id,"units","kg m-2"))
  +			varid(17)=temp_id
  +		endif
   		
   		call check( nf90_def_var(ncid, "z",  NF90_REAL, dimids, temp_id) )
   		call check( nf90_put_att(ncid,temp_id,"standard_name","height"))
  
positive.code: 		call check( nf90_put_var(ncid, varid(14), domain%rain) )
  		call check( nf90_put_var(ncid, varid(15), domain%snow) )
  		call check( nf90_put_var(ncid, varid(16), domain%graupel) )
  		call check( nf90_put_var(ncid, varid(17), domain%crain) )
  		call check( nf90_put_var(ncid, varid(18), domain%swdown) )
  		call check( nf90_put_var(ncid, varid(19), domain%lwdown) )
  		call check( nf90_put_var(ncid, varid(20), domain%z) )
  		call check( nf90_put_var(ncid, varid(21), domain%rho) )
  		call check( nf90_put_var(ncid, varid(22), domain%cloudfrac) )
  		call check( nf90_put_var(ncid, varid(23), domain%sensible_heat) )
  		call check( nf90_put_var(ncid, varid(24), domain%latent_heat) )
  		call check( nf90_put_var(ncid, varid(25), domain%ground_heat) )
  		call check( nf90_put_var(ncid, varid(26), domain%soil_vwc) )
  		call check( nf90_put_var(ncid, varid(27), domain%soil_t) )
  		call check( nf90_put_var(ncid, varid(28), domain%skin_t) )
  		call check( nf90_put_var(ncid, varid(29), domain%lwup) )
  		call check( nf90_put_var(ncid, varid(30), domain%snow_swe) )
  		call check( nf90_put_var(ncid, varid(31), domain%canopy_water) )
  	
  		! Close the file, freeing all resources.
  		call check( nf90_close(ncid) )
  
negative.code: 		call check( nf90_put_var(ncid, varid(3),  domain%ice) )
  		call check( nf90_put_var(ncid, varid(4),  domain%qrain) )
  		call check( nf90_put_var(ncid, varid(5),  domain%qsnow) )
  		! these should only be output for thompson microphysics
  		if (options%physics%microphysics==1) then
  			call check( nf90_put_var(ncid, varid(6),  domain%qgrau) )
  			call check( nf90_put_var(ncid, varid(7),  domain%nrain) )
  			call check( nf90_put_var(ncid, varid(8),  domain%nice) )
  		endif
  		call check( nf90_put_var(ncid, varid(9),  domain%u) )
  		call check( nf90_put_var(ncid, varid(10), domain%v) )
  		call check( nf90_put_var(ncid, varid(11), domain%w) )
  